spaam/svtplay-dl

The last modification to subtitles still does not work for pluto.tv

Closed this issue · 4 comments

svtplay-dl versions:

svtplay-dl 4.25-6-g4853569

Operating system and Python version:

Windows 10
Python 3.8.0

What is the issue:

The program gets a fatal exception when subtitles are requested.
(I removed the middle part, because the output is too long.)

svtplay-dl --verbose -S https://pluto.tv/en/on-demand/series/svenska-truckers-sv/season/8/episode/avsnitt-807-2019-8-7
DEBUG [1696933013.3475103] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\getmedia.py/get_media: version: 4.25-6-g4853569
DEBUG [1696933013.3525078] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\service_init_.py/init: service: plutotv
DEBUG [1696933013.3535395] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://pluto.tv/en/on-demand/series/svenska-truckers-sv/season/8/episode/avsnitt-807-2019-8-7'
DEBUG [1696933013.3556688] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_new_conn: Starting new HTTPS connection (1): pluto.tv:443
DEBUG [1696933014.0500119] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://pluto.tv:443 "GET /en/on-demand/series/svenska-truckers-sv/season/8/episode/avsnitt-807-2019-8-7 HTTP/1.1" 200 None
DEBUG [1696933014.0946834] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://boot.pluto.tv/v4/start'
DEBUG [1696933014.0996876] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_new_conn: Starting new HTTPS connection (1): boot.pluto.tv:443
DEBUG [1696933014.472842] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://boot.pluto.tv:443 "GET /v4/start?appName=web&appVersion=7.7.0-18f7ab32608969ea5bcbce8d0e23b9d0e1b24717&deviceVersion=100.0.0&deviceModel=web&deviceMake=firefox&deviceType=web&clientID=22a1e193-6756-11ee-b0af-3ca9f48486f8&clientModelNumber=1.0.0&episodeSlugs=svenska-truckers-sv&serverSideAds=false&constraints=&drmCapabilities=widevine%253AL3&clientTime=2023-10-10T10%3A16%3A54Z HTTP/1.1" 200 None
DEBUG [1696933014.563805] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://service-vod.clusters.pluto.tv/v4/vod/slugs/svenska-truckers-sv'
DEBUG [1696933014.572824] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_new_conn: Starting new HTTPS connection (1): service-vod.clusters.pluto.tv:443
DEBUG [1696933015.0165093] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://service-vod.clusters.pluto.tv:443 "GET /v4/vod/slugs/svenska-truckers-sv?appName=web&appVersion=7.7.0-18f7ab32608969ea5bcbce8d0e23b9d0e1b24717&deviceVersion=100.0.0&deviceModel=web&deviceMake=firefox&deviceType=web&clientID=22a1e193-6756-11ee-b0af-3ca9f48486f8&clientModelNumber=1.0.0&episodeSlugs=svenska-truckers-sv&serverSideAds=false&constraints=&drmCapabilities=widevine%253AL3&clientTime=2023-10-10T10%3A16%3A54Z HTTP/1.1" 200 None
DEBUG [1696933015.0215037] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://cfd-v4-service-channel-stitcher-use1-1.prd.pluto.tv/stitch/hls/episode/651691b02a6001001a19a7a0/master.m3u8?advertisingId=&appName=web&appVersion=7.7.0-18f7ab32608969ea5bcbce8d0e23b9d0e1b24717&app_name=web&clientDeviceType=0&clientID=22a1e193-6756-11ee-b0af-3ca9f48486f8&clientModelNumber=1.0.0&country=SE&deviceDNT=false&deviceId=22a1e193-6756-11ee-b0af-3ca9f48486f8&deviceLat=59.3287&deviceLon=18.0717&deviceMake=firefox&deviceModel=web&deviceType=web&deviceVersion=100.0.0&marketingRegion=SE&serverSideAds=false&sessionID=2142693a-6756-11ee-9188-eaa9c3955f7f&sid=2142693a-6756-11ee-9188-eaa9c3955f7f&userId='
DEBUG [1696933015.025502] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_new_conn: Starting new HTTPS connection (1): cfd-v4-service-channel-stitcher-use1-1.prd.pluto.tv:443
DEBUG [1696933016.5050344] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://cfd-v4-service-channel-stitcher-use1-1.prd.pluto.tv:443 "GET /stitch/hls/episode/651691b02a6001001a19a7a0/master.m3u8?advertisingId=&appName=web&appVersion=7.7.0-18f7ab32608969ea5bcbce8d0e23b9d0e1b24717&app_name=web&clientDeviceType=0&clientID=22a1e193-6756-11ee-b0af-3ca9f48486f8&clientModelNumber=1.0.0&country=SE&deviceDNT=false&deviceId=22a1e193-6756-11ee-b0af-3ca9f48486f8&deviceLat=59.3287&deviceLon=18.0717&deviceMake=firefox&deviceModel=web&deviceType=web&deviceVersion=100.0.0&marketingRegion=SE&serverSideAds=false&sessionID=2142693a-6756-11ee-9188-eaa9c3955f7f&sid=2142693a-6756-11ee-9188-eaa9c3955f7f&userId= HTTP/1.1" 200 2328
DEBUG [1696933016.5070314] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://cfd-v4-service-channel-stitcher-use1-1.prd.pluto.tv/stitch/hls/episode/651691b02a6001001a19a7a0/master.m3u8?advertisingId=&appName=web&appVersion=7.7.0-18f7ab32608969ea5bcbce8d0e23b9d0e1b24717&app_name=web&clientDeviceType=0&clientID=22a1e193-6756-11ee-b0af-3ca9f48486f8&clientModelNumber=1.0.0&country=SE&deviceDNT=false&deviceId=22a1e193-6756-11ee-b0af-3ca9f48486f8&deviceLat=59.3287&deviceLon=18.0717&deviceMake=firefox&deviceModel=web&deviceType=web&deviceVersion=100.0.0&marketingRegion=SE&serverSideAds=false&sessionID=2142693a-6756-11ee-9188-eaa9c3955f7f&sid=2142693a-6756-11ee-9188-eaa9c3955f7f&userId='
DEBUG [1696933016.7255821] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://cfd-v4-service-channel-stitcher-use1-1.prd.pluto.tv:443 "GET /stitch/hls/episode/651691b02a6001001a19a7a0/master.m3u8?advertisingId=&appName=web&appVersion=7.7.0-18f7ab32608969ea5bcbce8d0e23b9d0e1b24717&app_name=web&clientDeviceType=0&clientID=22a1e193-6756-11ee-b0af-3ca9f48486f8&clientModelNumber=1.0.0&country=SE&deviceDNT=false&deviceId=22a1e193-6756-11ee-b0af-3ca9f48486f8&deviceLat=59.3287&deviceLon=18.0717&deviceMake=firefox&deviceModel=web&deviceType=web&deviceVersion=100.0.0&marketingRegion=SE&serverSideAds=false&sessionID=2142693a-6756-11ee-9188-eaa9c3955f7f&sid=2142693a-6756-11ee-9188-eaa9c3955f7f&userId= HTTP/1.1" 200 2328
DEBUG [1696933016.7383301] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://cfd-v4-service-channel-stitcher-use1-1.prd.pluto.tv/stitch/hls/episode/651691b02a6001001a19a7a0/subtitle/sv/playlist.m3u8?terminate=false&sid=2142693a-6756-11ee-9188-eaa9c3955f7f&deviceDNT=0&deviceLat=59.3287&deviceLon=18.0717&deviceModel=web&deviceVersion=100.0.0&appName=web&deviceId=22a1e193-6756-11ee-b0af-3ca9f48486f8&appVersion=7.7.0-18f7ab32608969ea5bcbce8d0e23b9d0e1b24717&deviceType=web&deviceMake=firefox'
DEBUG [1696933016.7438452] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_new_conn: Starting new HTTPS connection (1): cfd-v4-service-channel-stitcher-use1-1.prd.pluto.tv:443
DEBUG [1696933017.1394973] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://cfd-v4-service-channel-stitcher-use1-1.prd.pluto.tv:443 "GET /stitch/hls/episode/651691b02a6001001a19a7a0/subtitle/sv/playlist.m3u8?terminate=false&sid=2142693a-6756-11ee-9188-eaa9c3955f7f&deviceDNT=0&deviceLat=59.3287&deviceLon=18.0717&deviceModel=web&deviceVersion=100.0.0&appName=web&deviceId=22a1e193-6756-11ee-b0af-3ca9f48486f8&appVersion=7.7.0-18f7ab32608969ea5bcbce8d0e23b9d0e1b24717&deviceType=web&deviceMake=firefox HTTP/1.1" 200 96603
[... REMOVED MANY LINES ...]
DEBUG [1696932491.3459811] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://siloh-sp.plutotv.net:443 "GET /019_pluto/clip/651691ae2a6001001a19a783_Svenska_Truckers_SV_Avsnitt_807_S8E7/720pDRM/20230929_015823/hls/1658761-end/sv-cc/00170.vtt HTTP/1.1" 200 188
DEBUG [1696932491.3469806] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://siloh-sp.plutotv.net/019_pluto/clip/651691ae2a6001001a19a783_Svenska_Truckers_SV_Avsnitt_807_S8E7/720pDRM/20230929_015823/hls/1658761-end/sv-cc/00171.vtt'
DEBUG [1696932491.388066] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://siloh-sp.plutotv.net:443 "GET /019_pluto/clip/651691ae2a6001001a19a783_Svenska_Truckers_SV_Avsnitt_807_S8E7/720pDRM/20230929_015823/hls/1658761-end/sv-cc/00171.vtt HTTP/1.1" 200 132
DEBUG [1696932491.3890674] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://siloh-sp.plutotv.net/019_pluto/clip/651691ae2a6001001a19a783_Svenska_Truckers_SV_Avsnitt_807_S8E7/720pDRM/20230929_015823/hls/1658761-end/sv-cc/00172.vtt'
DEBUG [1696932491.4282079] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://siloh-sp.plutotv.net:443 "GET /019_pluto/clip/651691ae2a6001001a19a783_Svenska_Truckers_SV_Avsnitt_807_S8E7/720pDRM/20230929_015823/hls/1658761-end/sv-cc/00172.vtt HTTP/1.1" 200 55

Traceback (most recent call last):
File "C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\cx_Freeze\initscripts_startup_.py", line 124, in run
File "C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\cx_Freeze\initscripts\console.py", line 16, in run
File "bin\svtplay-dl", line 7, in
File "D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl_init_.py", line 69, in main
File "D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\getmedia.py", line 63, in get_media
File "D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\getmedia.py", line 157, in get_one_media
File "D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\stream.py", line 107, in subtitle_decider
File "C:\Program Files\Svtplay-dl\lib\svtplay_dl\subtitle_init_.py", line 97, in download
data = self.wrstsegment(subdata)
File "C:\Program Files\Svtplay-dl\lib\svtplay_dl\subtitle_init_.py", line 316, in wrstsegment
return wrstsegments(pretext, self.config.get("convert_subtitle_colors"))
File "C:\Program Files\Svtplay-dl\lib\svtplay_dl\subtitle_init
.py", line 381, in _wrstsegments
subs[-1][0] = f"{ha.group(1).replace('.', ',')} --> {sec2str(second).replace('.', ',')}"
AttributeError: 'NoneType' object has no attribute 'group'

I printed out the values of some variables when the exception occurred:
subs[-1][0] = '-1:59:56,559 --> 00:00:01,239'
item = '00:00:05.559 --> 00:00:10.239'
itmes = ['WEBVTT', 'X-TIMESTAMP-MAP=MPEGTS:90000,LOCAL:00:00:00.000', '00:00:05.559 --> 00:00:10.239', 'Fullt fokus. Gör jag inte', 'precis rätt, går det inte.', '00:00:11.559 --> 00:00:17.959', 'Om jag verkligen hamnat i ett läge', 'som jag inte kommer att reda ut-']
x = 2

As you can see, subs[-1][0] starts with a negative time, which is not matched by strdate, and hence, it returns None, which of course has no group-attribute.

spaam commented

yeah. the issue is that they have a bunch of ads in middle of their video and the time codes will be bit wrong. because of that we get a negative time when trying to fix it.
im thinking about removing support of pluto or just disable support for subs when using pluto 🤔

Erbe28 commented

Subs on Pluto works just fine for me. Please don't disable the sub support.

I get stuck and it look like this when i try to download:
https://pluto.tv/en/on-demand/series/6557380362063800133d019e/season/1/episode/6557380662063800133d0281

DEBUG [1705187615.7419908] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://siloh-ns1.plutotv.net:443 "GET /663_CBS_TV/clip/6554f4a28026ff001a8bf66e_MacGyver_Pilot_S01E001/720p/20231115_084642/hls/921890-2148649/en-cc/00063.vtt HTTP/1.1" 200 117
DEBUG [1705187615.7419908] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://siloh-ns1.plutotv.net/663_CBS_TV/clip/6554f4a28026ff001a8bf66e_MacGyver_Pilot_S01E001/720p/20231115_084642/hls/921890-2148649/en-cc/00064.vtt'
DEBUG [1705187615.768645] C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connectionpool.py/_make_request: https://siloh-ns1.plutotv.net:443 "GET /663_CBS_TV/clip/6554f4a28026ff001a8bf66e_MacGyver_Pilot_S01E001/720p/20231115_084642/hls/921890-2148649/en-cc/00064.vtt HTTP/1.1" 200 100
DEBUG [1705187615.768645] D:\a\svtplay-dl\svtplay-dl\lib\svtplay_dl\utils\http.py/request: HTTP getting 'https://siloh-ns1.plutotv.net/663_CBS_TV/clip/6554f4a28026ff001a8bf66e_MacGyver_Pilot_S01E001/720p/20231115_084642/hls/921890-2148649/en-cc/00065.vtt'

but maybe that isn't the same issue as the OP?

they have subs split in several files so its expected to take a while to fetch all these .vtt files. this is an old issue. open a new one if there is a crash with 4.69.