internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: streamlink/streamlink

Issue:
Can't Download Picarto Video
## Bug Report

- [X ] I have read the contribution guidelines. 

### Description

Picarto.tv plugin doesn't seem to download any recorded streams anymore

### Expected / Actual behavior

Expected it to download video, didn't

### Reproduction steps / Explicit stream URLs to test

1. streamlink -o Amarynceus.flv https://picarto.tv/videopopout/Amarynceus_2018.07.04.22.55.48.flv

### Logs


```
streamlink -o Amarynceus.flv https://picarto.tv/videopopout/Amarynceus_2018.07.04.22.55.48.flv -l debug
[cli][debug] OS:         Linux-4.15.0-24-generic-x86_64-with-Ubuntu-18.04-bionic
[cli][debug] Python:     2.7.15rc1
[cli][debug] Streamlink: 0.14.2+24.g6bf654a2
[cli][debug] Requests(2.19.1), Socks(1.6.7), Websocket(0.48.0)
[cli][info] Found matching plugin picarto for URL https://picarto.tv/videopopout/Amarynceus_2018.07.04.22.55.48.flv
[plugin.picarto][debug] Possible VOD stream...
[plugin.picarto][warning] Probably a VOD stream but no VOD found?
[plugin.picarto][error] The channel Amarynceus_2018.07.04.22.55.48.flv does not exist
error: No playable streams found on this URL: https://picarto.tv/videopopout/Amarynceus_2018.07.04.22.55.48.flv
```


Discussion:

Resolving patch:
diff --git a/src/streamlink/plugins/picarto.py b/src/streamlink/plugins/picarto.py
--- a/src/streamlink/plugins/picarto.py
+++ b/src/streamlink/plugins/picarto.py
@@ -4,8 +4,10 @@
 import json
 
 from streamlink.plugin import Plugin
+from streamlink.plugin.api import validate
 from streamlink.stream import HLSStream
 from streamlink.stream import RTMPStream
+from streamlink.utils import parse_json
 
 
 class Picarto(Plugin):
@@ -15,13 +17,29 @@ class Picarto(Plugin):
     RTMP_PLAYPATH = "golive+{channel}?token={token}"
     HLS_URL = "https://{server}/hls/{channel}/index.m3u8?token={token}"
 
+
     # Regex for all usable URLs
     _url_re = re.compile(r"""
         https?://(?:\w+\.)?picarto\.tv/(?:videopopout/)?([^&?/]+)
     """, re.VERBOSE)
 
     # Regex for VOD extraction
-    _vod_re = re.compile(r'''vod: "(https?://[\S]+?/index.m3u8)",''')
+    _vod_re = re.compile(r'''(?<=#vod-player", )(\{.*?\})''')
+
+    data_schema = validate.Schema(
+        validate.transform(_vod_re.search),
+        validate.any(
+            None,
+            validate.all(
+                validate.get(0),
+                validate.transform(parse_json),
+                {
+                    "vod": validate.url(),
+                }
+            )
+        )
+    )
+
 
     @classmethod
     def can_handle_url(cls, url):
@@ -52,9 +70,10 @@ def _create_flash_stream(self, server, channel, token):
         return RTMPStream(self.session, params=params)
 
     def _get_vod_stream(self, page):
-        m = self._vod_re.search(page.text)
-        if m:
-            return HLSStream.parse_variant_playlist(self.session, m.group(1))
+        data = self.data_schema.validate(page.text)
+
+        if data:
+            return HLSStream.parse_variant_playlist(self.session, data["vod"])
 
     def _get_streams(self):
         url_channel_name = self._url_re.match(self.url).group(1)


Test patch:
Repository: streamlink/streamlink

Issue:
Skai plugin broken
<!--
Thanks for reporting a plugin issue!
USE THE TEMPLATE. Otherwise your plugin issue may be rejected.

First, see the contribution guidelines:
https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#contributing-to-streamlink

Also check the list of open and closed plugin issues:
https://github.com/streamlink/streamlink/issues?q=is%3Aissue+label%3A%22plugin+issue%22

Please see the text preview to avoid unnecessary formatting errors.
-->


## Plugin Issue

- [x] This is a plugin issue and I have read the contribution guidelines.


### Description

Skai plugin is broken since yesterday, but actually it is no longer needed because they provide a lot more stable stream (they don't change stream three or so times a day). **Imho it can be removed.**

New live url as follows:

http://www.skaitv.gr/live



Discussion:

Resolving patch:
diff --git a/src/streamlink/plugins/skai.py b/src/streamlink/plugins/skai.py
--- a/src/streamlink/plugins/skai.py
+++ b/src/streamlink/plugins/skai.py
@@ -3,20 +3,15 @@
 from streamlink.plugin import Plugin
 from streamlink.plugin.api import validate
 
-YOUTUBE_URL = "https://www.youtube.com/watch?v={0}"
-_url_re = re.compile(r'http(s)?://www\.skai.gr/.*')
-_youtube_id = re.compile(r'<span\s+itemprop="contentUrl"\s+href="(.*)"></span>', re.MULTILINE)
-_youtube_url_schema = validate.Schema(
-    validate.all(
-        validate.transform(_youtube_id.search),
-        validate.any(
-            None,
-            validate.all(
-                validate.get(1),
-                validate.text
-            )
-        )
-    )
+
+_url_re = re.compile(r'http(s)?://www\.skai(?:tv)?.gr/.*')
+_api_url = "http://www.skaitv.gr/json/live.php"
+_api_res_schema = validate.Schema(validate.all(
+    validate.get("now"),
+    {
+        "livestream": validate.url()
+    },
+    validate.get("livestream"))
 )
 
 
@@ -26,9 +21,10 @@ def can_handle_url(cls, url):
         return _url_re.match(url)
 
     def _get_streams(self):
-        channel_id = self.session.http.get(self.url, schema=_youtube_url_schema)
-        if channel_id:
-            return self.session.streams(YOUTUBE_URL.format(channel_id))
+        api_res = self.session.http.get(_api_url)
+        yt_url = self.session.http.json(api_res, schema=_api_res_schema)
+        if yt_url:
+            return self.session.streams(yt_url)
 
 
 __plugin__ = Skai


Test patch:
diff --git a/tests/plugins/test_skai.py b/tests/plugins/test_skai.py
--- a/tests/plugins/test_skai.py
+++ b/tests/plugins/test_skai.py
@@ -7,6 +7,7 @@ class TestPluginSkai(unittest.TestCase):
     def test_can_handle_url(self):
         should_match = [
             'http://www.skai.gr/player/tvlive/',
+            'http://www.skaitv.gr/live',
         ]
         for url in should_match:
             self.assertTrue(Skai.can_handle_url(url))
Repository: streamlink/streamlink

Issue:
powerapp.py No plugin can handle URL
## Error Report

- [X] This is a bug report and I have read the Posting Guidelines.

### Description

 powerapp.com.tr should be able to play the stations


### Expected / actual behavior

Inserting the page in the streamlink does not play the stream. About my web browser Firefox I see the picture and hear the sound synonymous

### Reproduction steps / Explicit stream URLs to test

1.www.powerapp.com.tr/tvs/powertv/

streamlink http://www.powerapp.com.tr/tvs/powertv best

### log output

> streamlink http://www.powerapp.com.tr/tvs/powertv best
error: No plugin can handle URL: http://www.powerapp.com.tr/tvs/powertv
> error: No plugin can handle URL: http://www.powerapp.com.tr/tvs/powertv
error:: The term "error:" was not used as the name of a cmdlet, a function, a script file, or a
recognized executable program. Check the spelling of the name, or if the path is correct (provided
contain) and repeat the process.
In line: 1 character: 1
+ error: No plugin can handle URL: http://www.powerapp.com.tr/tvs/power ...
+~~~~~
    + CategoryInfo: ObjectNotFound: (error :: String) [], CommandNotFoundException
    + FullyQualifiedErrorId: CommandNotFoundException


### Additional comments, screenshots, etc.

 Screenshot

https://i.ibb.co/g99nXC0/france.jpg


Discussion:

Resolving patch:
diff --git a/src/streamlink/plugins/powerapp.py b/src/streamlink/plugins/powerapp.py
--- a/src/streamlink/plugins/powerapp.py
+++ b/src/streamlink/plugins/powerapp.py
@@ -7,7 +7,7 @@
 
 
 class PowerApp(Plugin):
-    url_re = re.compile(r"https?://(?:www.)?powerapp.com.tr/tv/(\w+)")
+    url_re = re.compile(r"https?://(?:www.)?powerapp.com.tr/tvs?/(\w+)")
     api_url = "http://api.powergroup.com.tr/Channels/{0}/?appRef=iPowerWeb&apiVersion=11"
     api_schema = validate.Schema(validate.all({
         "errorCode": 0,


Test patch:
diff --git a/tests/plugins/test_powerapp.py b/tests/plugins/test_powerapp.py
--- a/tests/plugins/test_powerapp.py
+++ b/tests/plugins/test_powerapp.py
@@ -9,9 +9,10 @@ def test_can_handle_url(self):
             'http://powerapp.com.tr/tv/powertv4k',
             'http://powerapp.com.tr/tv/powerturktv4k',
             'http://powerapp.com.tr/tv/powerEarthTV',
+            'http://www.powerapp.com.tr/tvs/powertv'
         ]
         for url in should_match:
-            self.assertTrue(PowerApp.can_handle_url(url))
+            self.assertTrue(PowerApp.can_handle_url(url), url)
 
     def test_can_handle_url_negative(self):
         should_not_match = [
Repository: streamlink/streamlink

Issue:
Update dependencies with security vulnerabilities
As mentioned here:
https://github.com/streamlink/streamlink/pull/2199#issuecomment-447567326

1. urllib3
   > Vulnerable versions: < 1.23
   > Patched version: 1.23
   > urllib3 before version 1.23 does not remove the Authorization HTTP header when following a cross-origin redirect (i.e., a redirect that differs in host, port, or scheme). This can allow for credentials in the Authorization header to be exposed to unintended hosts or transmitted in cleartext.
   https://nvd.nist.gov/vuln/detail/CVE-2018-20060
2. requests
   > Vulnerable versions: <= 2.19.1
   > Patched version: 2.20.0
   > The Requests package through 2.19.1 before 2018-09-14 for Python sends an HTTP Authorization header to an http URI upon receiving a same-hostname https-to-http redirect, which makes it easier for remote attackers to discover credentials by sniffing the network.
   https://nvd.nist.gov/vuln/detail/CVE-2018-18074



Discussion:
This should be the last blocker for https://github.com/streamlink/streamlink/pull/2199 @cdrage.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -13,8 +13,8 @@
     'futures;python_version<"3.0"',
     # Require singledispatch on Python <3.4
     'singledispatch;python_version<"3.4"',
-    "requests>=2.2,!=2.12.0,!=2.12.1,!=2.16.0,!=2.16.1,!=2.16.2,!=2.16.3,!=2.16.4,!=2.16.5,!=2.17.1,<3.0",
-    'urllib3[secure]<1.23,>=1.21.1;python_version<"3.0"',
+    "requests>=2.21.0,<3.0",
+    'urllib3[secure]>=1.23;python_version<"3.0"',
     "isodate",
     "websocket-client",
     # Support for SOCKS proxies


Test patch:
Repository: streamlink/streamlink

Issue:
Plugin: cdnbg
Domain for BSTV has been changed to https://live.bstv.bg/.


Discussion:

Resolving patch:
diff --git a/src/streamlink/plugins/cdnbg.py b/src/streamlink/plugins/cdnbg.py
--- a/src/streamlink/plugins/cdnbg.py
+++ b/src/streamlink/plugins/cdnbg.py
@@ -23,6 +23,7 @@ class CDNBG(Plugin):
             mmtvmusic\.com/live|
             mu-vi\.tv/LiveStreams/pages/Live\.aspx|
             videochanel\.bstv\.bg|
+            live\.bstv\.bg|
             bloombergtv.bg/video
         )/?
     """, re.VERBOSE)


Test patch:
diff --git a/tests/plugins/test_cdnbg.py b/tests/plugins/test_cdnbg.py
--- a/tests/plugins/test_cdnbg.py
+++ b/tests/plugins/test_cdnbg.py
@@ -23,6 +23,7 @@ def test_can_handle_url(self):
         self.assertTrue(CDNBG.can_handle_url("https://mmtvmusic.com/live/"))
         self.assertTrue(CDNBG.can_handle_url("http://mu-vi.tv/LiveStreams/pages/Live.aspx"))
         self.assertTrue(CDNBG.can_handle_url("http://videochanel.bstv.bg/"))
+        self.assertTrue(CDNBG.can_handle_url("http://live.bstv.bg/"))
         self.assertTrue(CDNBG.can_handle_url("https://www.bloombergtv.bg/video"))
 
         # shouldn't match
Repository: streamlink/streamlink

Issue:
BBC Links stopped working?
Anyone else BBC links stopped working?


Discussion:
We really can't do anything with an issue report like this. Please review the template and provide the debug log and other output requested there.

Resolving patch:
diff --git a/src/streamlink/plugins/bbciplayer.py b/src/streamlink/plugins/bbciplayer.py
--- a/src/streamlink/plugins/bbciplayer.py
+++ b/src/streamlink/plugins/bbciplayer.py
@@ -34,11 +34,8 @@ class BBCiPlayer(Plugin):
     tvip_re = re.compile(r'channel"\s*:\s*{\s*"id"\s*:\s*"(\w+?)"')
     tvip_master_re = re.compile(r'event_master_brand=(\w+?)&')
     account_locals_re = re.compile(r'window.bbcAccount.locals\s*=\s*({.*?});')
-    swf_url = "http://emp.bbci.co.uk/emp/SMPf/1.18.3/StandardMediaPlayerChromelessFlash.swf"
-    hash = base64.b64decode(
-        b"N2RmZjc2NzFkMGM2OTdmZWRiMWQ5MDVkOWExMjE3MTk5MzhiOTJiZg==")
-    api_url = ("http://open.live.bbc.co.uk/mediaselector/6/select/"
-               "version/2.0/mediaset/{platform}/vpid/{vpid}/format/json/atk/{vpid_hash}/asn/1/")
+    hash = base64.b64decode(b"N2RmZjc2NzFkMGM2OTdmZWRiMWQ5MDVkOWExMjE3MTk5MzhiOTJiZg==")
+    api_url = "https://open.live.bbc.co.uk/mediaselector/6/select/version/2.0/mediaset/{platform}/vpid/{vpid}/format/json/atk/{vpid_hash}/asn/1/"
     platforms = ("pc", "iptv-all")
     session_url = "https://session.bbc.com/session"
     auth_url = "https://account.bbc.com/signin"


Test patch:
Repository: streamlink/streamlink

Issue:
[Plugin Request] Willax TV
## Plugin Request
- [x] This is a plugin request and I have read the contribution guidelines and plugin request requirements.


### Description
Willax Television (better known as Willax ) is an open television channel in Lima / Peru. Centered on entertainment programs, animes, South Korean novels, miscellany and politics.


### Example stream URLs
http://willax.tv/en-vivo/


### Additional comments, screenshots, etc.
Occasionally geo-blocked in Europe. 


Discussion:

Resolving patch:
diff --git a/src/streamlink/plugins/willax.py b/src/streamlink/plugins/willax.py
new file mode 100644
--- /dev/null
+++ b/src/streamlink/plugins/willax.py
@@ -0,0 +1,26 @@
+import logging
+import re
+
+from streamlink.compat import html_unescape
+from streamlink.plugin import Plugin
+from streamlink.plugin.api import useragents
+from streamlink.plugin.api.utils import itertags
+
+log = logging.getLogger(__name__)
+
+
+class Willax(Plugin):
+    _url_re = re.compile(r'https?://(?:www\.)?willax\.tv/en-vivo')
+
+    @classmethod
+    def can_handle_url(cls, url):
+        return cls._url_re.match(url) is not None
+
+    def _get_streams(self):
+        self.session.http.headers.update({'User-Agent': useragents.FIREFOX})
+        res = self.session.http.get(self.url)
+        for iframe in itertags(res.text, 'iframe'):
+            return self.session.streams(html_unescape(iframe.attributes.get('src')))
+
+
+__plugin__ = Willax


Test patch:
diff --git a/tests/plugins/test_willax.py b/tests/plugins/test_willax.py
new file mode 100644
--- /dev/null
+++ b/tests/plugins/test_willax.py
@@ -0,0 +1,19 @@
+import unittest
+
+from streamlink.plugins.willax import Willax
+
+
+class TestPluginWillax(unittest.TestCase):
+    def test_can_handle_url(self):
+        should_match = [
+            'http://willax.tv/en-vivo/',
+        ]
+        for url in should_match:
+            self.assertTrue(Willax.can_handle_url(url), url)
+
+    def test_can_handle_url_negative(self):
+        should_not_match = [
+            'http://willax.tv/',
+        ]
+        for url in should_not_match:
+            self.assertFalse(Willax.can_handle_url(url), url)
Repository: streamlink/streamlink

Issue:
[removal] Eurocom plugin no longer required
## Bug Report
<!-- Replace [ ] with [x] in order to check the box -->
- [x] This is a bug report and I have read the contribution guidelines.

### Description
When opening the main link, nothing happens.

### Reproduction steps / Explicit stream URLs to test
https://eurocom.bg/live


Discussion:
They are using a static HLS address now instead of a rtmp stream, which means the plugin can/should be removed now:

```
$ streamlink -l debug https://eurocom.bg/hls/stream.m3u8
[cli][debug] OS:         Linux-5.6.0-1-git-x86_64-with-glibc2.2.5
[cli][debug] Python:     3.8.2
[cli][debug] Streamlink: 1.3.1+113.g1b287a6
[cli][debug] Requests(2.23.0), Socks(1.7.1), Websocket(0.56.0)
[cli][info] Found matching plugin hls for URL https://eurocom.bg/hls/stream.m3u8
[plugin.hls][debug] URL=https://eurocom.bg/hls/stream.m3u8; params={}
[utils.l10n][debug] Language code: en_US
Available streams: live (worst, best)
```
Didn't notice they'd done that, I agree that the plugin is no longer required.

Resolving patch:
diff --git a/src/streamlink/plugins/eurocom.py b/src/streamlink/plugins/eurocom.py
deleted file mode 100644
--- a/src/streamlink/plugins/eurocom.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from __future__ import print_function
-import re
-
-from streamlink.plugin import Plugin
-from streamlink.stream import RTMPStream
-
-
-class Eurocom(Plugin):
-    url_re = re.compile(r"https?://(?:www\.)?eurocom.bg/live/?")
-    file_re = re.compile(r"file:.*?(?P<q>['\"])(?P<url>rtmp://[^\"']+)(?P=q),")
-
-    @classmethod
-    def can_handle_url(cls, url):
-        return cls.url_re.match(url) is not None
-
-    def _get_streams(self):
-        res = self.session.http.get(self.url)
-        m = self.file_re.search(res.text)
-        if m:
-            stream_url = m.group("url")
-            yield "live", RTMPStream(self.session, params={"rtmp": stream_url})
-
-
-__plugin__ = Eurocom


Test patch:
diff --git a/tests/plugins/test_eurocom.py b/tests/plugins/test_eurocom.py
deleted file mode 100644
--- a/tests/plugins/test_eurocom.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import unittest
-
-from streamlink.plugins.eurocom import Eurocom
-
-
-class TestPluginEurocom(unittest.TestCase):
-    def test_can_handle_url(self):
-        # should match
-        self.assertTrue(Eurocom.can_handle_url("http://eurocom.bg/live"))
-        self.assertTrue(Eurocom.can_handle_url("http://eurocom.bg/live/"))
-        self.assertTrue(Eurocom.can_handle_url("http://www.eurocom.bg/live/"))
-        self.assertTrue(Eurocom.can_handle_url("http://www.eurocom.bg/live"))
-
-        # shouldn't match
-        self.assertFalse(Eurocom.can_handle_url("http://www.tvcatchup.com/"))
-        self.assertFalse(Eurocom.can_handle_url("http://www.youtube.com/"))
Repository: streamlink/streamlink

Issue:
huya.com plugin - error message:  Unable to open URL: http://b''/ 
## Plugin Issue

- [x] This is a plugin issue and I have read the contribution guidelines.


### Description
Huya.com plugin suddenly stop working and throws always an error like
`Could not open stream: Unable to open URL: http://b''/ `
It seems the URL of the video cannot be extracted correctly.



### Reproduction steps / Explicit stream URLs to test

1. Go to huya.com and get an ID of active stream
2. Start streamlink recording like streamlink -f -o test.mpg https://www.huya.com/503376 best

### Log output

```
streamlink -f -o test.mpg https://www.huya.com/503376  best
[cli][info] Found matching plugin huya for URL https://www.huya.com/503376
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (hls)
[cli][error] Try 1/1: Could not open stream <HLSStream("http://b''/")> (Could not open stream: Unable to open URL: http://b''/ (HTTPConnectionPool(host="b''", port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe6633a4bb0>: Failed to establish a new connection: [Errno -2] Name or service not known'))))
error: Could not open stream <HLSStream("http://b''/")>, tried 1 times, exiting

```



Discussion:

Resolving patch:
diff --git a/src/streamlink/plugins/huya.py b/src/streamlink/plugins/huya.py
--- a/src/streamlink/plugins/huya.py
+++ b/src/streamlink/plugins/huya.py
@@ -8,20 +8,14 @@
 
 HUYA_URL = "http://m.huya.com/%s"
 
-_url_re = re.compile(r'http(s)?://(www\.)?huya.com/(?P<channel>[^/]+)', re.VERBOSE)
-_hls_re = re.compile(r'^\s*<video\s+id="html5player-video"\s+src="(?P<url>[^"]+)"', re.MULTILINE)
+_url_re = re.compile(r'https?://(www\.)?huya.com/(?P<channel>[^/]+)')
+_hls_re = re.compile(r'liveLineUrl\s*=\s*"(?P<url>[^"]+)"')
 
 _hls_schema = validate.Schema(
-    validate.all(
-        validate.transform(_hls_re.search),
-        validate.any(
-            None,
-            validate.all(
-                validate.get('url'),
-                validate.transform(str)
-            )
-        )
-    )
+    validate.transform(_hls_re.search),
+    validate.any(None, validate.get("url")),
+    validate.transform(lambda v: update_scheme("http://", v)),
+    validate.url()
 )
 
 
@@ -38,7 +32,7 @@ def _get_streams(self):
         # Some problem with SSL on huya.com now, do not use https
 
         hls_url = self.session.http.get(HUYA_URL % channel, schema=_hls_schema)
-        yield "live", HLSStream(self.session, update_scheme("http://", hls_url))
+        yield "live", HLSStream(self.session, hls_url)
 
 
 __plugin__ = Huya


Test patch:
Repository: streamlink/streamlink

Issue:
FOX TR not working anymore
Plugin foxtr.py not working since a few days.

Can someone have a look please?

Greetings


Discussion:
This issue doesn't meet any of the requirements. Provide them like the issue template said to do.
The command line is giving the following error message:

" [cli][info] Found matching plugin foxtr for URL https://www.fox.com.tr/canli-yayin
error: No playable streams found on this URL: https://www.fox.com.tr/canli-yayin "

Resolving patch:
diff --git a/src/streamlink/plugins/foxtr.py b/src/streamlink/plugins/foxtr.py
--- a/src/streamlink/plugins/foxtr.py
+++ b/src/streamlink/plugins/foxtr.py
@@ -16,7 +16,7 @@ class FoxTR(Plugin):
            foxplay.com.tr/.*)
     """, re.VERBOSE)
 
-    playervars_re = re.compile(r"source\s*:\s*\[\s*\{\s*videoSrc\s*:\s*'(.*?)'", re.DOTALL)
+    playervars_re = re.compile(r"source\s*:\s*\[\s*\{\s*videoSrc\s*:\s*(?:mobilecheck\(\)\s*\?\s*)?'([^']+)'")
 
     @classmethod
     def can_handle_url(cls, url):


Test patch:
Repository: streamlink/streamlink

Issue:
Two timecode-related features request
I would like to request two minor improvmenets related to timecodes.

1) Make milliseconds value at log with loglevel trace to be three-digit at all time. Now this value is being represented with two or one digit when event happend at the start of second. Please, make it to append zeroes, like 20:20:29,003. At latest version same timecode will be shown as 20:20:29,3.
This change will make log file more easily human-readable.
2) Make streamlink to set time-date of file being written to disk based not on time when script was executed, but based on time-date of last segment provided by server. Each writing of new segment to output file should update time-date of output file to match to time-date of this written segment. So, for example, complete and finished downloading of VOD video should create a file with same time-date as last segment of VOD had.


Discussion:
> At latest version same timecode will be shown as 20:20:29,3.
This change will make log file more easily human-readable.

it is **300** not **003**,
there is not really a big benefit for showing zeros

it is already readable because there are only 3 digits

> Make streamlink to set time-date of file being written to disk based not on time when script was executed, but based on time-date of last segment provided by server. Each writing of new segment to output file should update time-date of output file to match to time-date of this written segment. So, for example, complete and finished downloading of VOD video should create a file with same time-date as last segment of VOD had.

seems totally out of scope for streamlink

Resolving patch:
diff --git a/src/streamlink_cli/main.py b/src/streamlink_cli/main.py
--- a/src/streamlink_cli/main.py
+++ b/src/streamlink_cli/main.py
@@ -957,7 +957,7 @@ def check_version(force=False):
 
 
 def setup_logging(stream=sys.stdout, level="info"):
-    fmt = ("[{asctime},{msecs:0.0f}]" if level == "trace" else "") + "[{name}][{levelname}] {message}"
+    fmt = ("[{asctime},{msecs:03.0f}]" if level == "trace" else "") + "[{name}][{levelname}] {message}"
     logger.basicConfig(stream=stream, level=level,
                        format=fmt, style="{",
                        datefmt="%H:%M:%S")


Test patch: