aajanki / yle-dl

Download videos from Yle servers
https://aajanki.github.io/yle-dl/index-en.html
GNU General Public License v3.0
309 stars 52 forks source link

Download fails for certain urls with "TypeError: sequence item 402: expected string, int found" #152

Closed utelle closed 6 years ago

utelle commented 6 years ago

I successfully installed version 2.31 of yle-dl on my Windows 7 system using Python 2.7.

In most cases invoking yle-dl using the following command line works flawlessly:

yle-dl --vfat --sublang all --maxbitrate best --adobehds "php c:\yle-dl-2.31\yledl\AdobeHDS.php" --wget c:\yle-dl-2.31\yledl\wget.exe --ffmpeg c:\yle-dl-2.31\yledl\ffmpeg.exe --ffprobe c:\yle-dl-2.31\yledl\ffprobe.exe --rtmpdump c:\yle-dl-2.31\yledl\rtmpdump.exe --destdir c:\Video\Areena <url>

However, for certain YLE areena urls, for example the following ones

https://areena.yle.fi/1-1303904 https://areena.yle.fi/1-3873472 https://areena.yle.fi/1-4023094

I get an error message TypeError: sequence item 402: expected string, int found. Following a traceback:

yle-dl 2.31: Download media files from Yle Areena and Elävä Arkisto
Copyright (C) 2009-2018 Antti Ajanki <antti.ajanki@iki.fi>, license: GPLv3
Output file: c:\Video\Rakastuin mä luuseriin_ S01E01_ Erehdys-2017-05-11T01_00.flv
Traceback (most recent call last):
  File "c:\python2711\Scripts\yle-dl-script.py", line 9, in <module>
    load_entry_point('yle-dl==2.31', 'console_scripts', 'yle-dl')()
  File "build\bdist.win32\egg\yledl\yledl.py", line 366, in main
  File "build\bdist.win32\egg\yledl\yledl.py", line 234, in download
  File "build\bdist.win32\egg\yledl\downloaders.py", line 993, in download_episodes
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1040, in process
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1143, in process_single_episode
  File "build\bdist.win32\egg\yledl\downloaders.py", line 986, in download_clip
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2353, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2379, in _retry_call
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2338, in wrapped
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2105, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1886, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1910, in external_downloader
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1945, in execute
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1984, in start_process

  File "c:\python2711\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "c:\python2711\lib\subprocess.py", line 913, in _execute_child
    args = list2cmdline(args)
  File "c:\python2711\lib\subprocess.py", line 644, in list2cmdline
    return ''.join(result)
TypeError: sequence item 402: expected string, int found

Am I doing anything wrong? Or is this a known issue/limitation of yle-dl?

aajanki commented 6 years ago

Thanks for reporting the problem. This seems to be a bug in yle-dl running on Windows. All three of your examples work when I try them on yle-dl 2.31 on Linux.

Can you please append the switch --verbose on the yle-dl command line and rerun one of the failing videos? Post the verbose output here (or send it to me by email, if it is very long, antti.ajanki@iki.fi). It might help me understand what is going wrong.

There is an alternative approach that doesn't really help finding out what is wrong but might get yle-dl working: The problem occurs when yle-dl is executing AdobeHDS.php. You can tell yle-dl to use youtube-dl instead of AdobeHDS.php by appending the switch --backend youtubedl. This of course works only if you have youtube-dl installed. I have never tried yle-dl + youtube-dl combination on Windows, but I guess that installing the youtube-dl executable from https://youtube-dl.org/ won't make youtube-dl available to Python programs such as yle-dl. You probably have to install the youtube-dl Python library using pip: pip install --upgrade youtube_dl.

utelle commented 6 years ago

Thanks for responding so quickly.

In the following please find --verbose output for 2 of the failing videos?

DEBUG: not a playlist
DEBUG: program data:
DEBUG: {"meta": {"callback": "yleEmbed.programJsonpCallback", "id": "1-1303904"}, "data": {"metrics": {"sola": {"category": "draama", "contentLength": "1693000", "show": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin", "contentType": "vod", "title": "20170511.1"}, "comscore": {"ns_st_ty": "vod", "yle_alternativeid": "16-1-0234683", "ns_st_el": "1693000", "ns_st_ep": "20170511.1", "ns_st_cl": "1693000", "fp_bd": "20170510", "ns_st_ci": "16-1-0234683", "yle_genreid": "5", "yle_category": "sarjatjaelokuvat;kotimaisetsarjat", "category": "draama", "yle_title": "rakastuin m\u00e4 luuseriin", "yle_truelength": "1693000", "ns_st_ge": "kotimainen fiktio", "yle_ss_ohjusid": "1-1303904", "ns_st_st": "vain_areenassa", "fp_clnr": "20001", "countername": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin", "fp_ty": "video_tv_program", "yle_stickytitle": "rakastuin m\u00e4 luuseriin", "yle_dayssincepublish": "312", "yle_language": "fi", "yle_ss_prodnumber": "53753501000", "ns_st_dt": "20170511", "fp_ch": "fp198", "content_type": "vod", "ns_st_pl": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin.20170511.1", "yle_metrics_api_data_version": "v2.1", "yle_ss_mediaid": "6-043e4e240dc946d1b99f23216c472ac6", "fp_prod_id": "na", "ns_st_pr": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin"}}, "program": {"creator": [], "image": {"available": true, "version": 1517315651, "type": "ImageObject", "id": "13-1-1303904"}, "productionId": "53753501000", "video": {"type": "VideoTrack", "language": [], "format": [{"type": "Concept", "inScheme": "mediaformat-classification", "key": "16:9"}]}, "duration": "PT28M13S", "id": "1-1303904", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-6", "notation": [{"valueType": "finnpanel-notation", "value": "5"}], "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "inScheme": "areena-content-classification", "key": "kotimaisetsarjat", "type": "Concept", "id": "5-133"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}], "indexDataModified": "2018-01-30T14:34:11.229+02:00", "episodeNumber": 1, "typeCreative": "Program", "subtitling": [], "partOfSeason": {"indexDataModified": "2017-12-15T10:00:47.921+02:00", "seasonNumber": 1, "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "countryOfOrigin": [], "creator": [], "productionId": "53753500000", "partOfSeries": {"id": "1-3802903"}, "type": "TVSeason", "id": "1-3794529", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-6", "notation": [{"valueType": "finnpanel-notation", "value": "5"}], "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "inScheme": "areena-content-classification", "key": "kotimaisetsarjat", "type": "Concept", "id": "5-133"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}]}, "contentRating": {"ratingSystem": "MEKU", "reason": [{"type": "ContentRatingReason", "key": "sex", "title": {"fi": "Sis\u00e4lt\u00e4\u00e4 seksi\u00e4", "en": "Sexual content", "sv": "Sexuellt inneh\u00e5ll"}}], "ageRestriction": 7, "type": "ContentRating", "title": {"fi": "Sallittu yli 7-vuotiaille", "en": "Not for persons under 7", "sv": "F\u00f6rbjudet under 7 \u00e5r"}}, "publicationEvent": [{"publisher": [{"id": "yle-areena"}], "temporalStatus": "currently", "service": {"id": "yle-areena"}, "tags": {"catalog": true}, "media": {"available": true, "contentProtection": [{"type": "ContentProtectionPolicy", "id": "22-1"}], "version": 1517315651, "downloadable": false, "duration": "PT28M13S", "type": "VideoObject", "id": "6-043e4e240dc946d1b99f23216c472ac6"}, "region": "Finland", "version": 1517315651, "startTime": "2017-05-11T01:00:00+03:00", "duration": "P11M4W1DT22H59M", "endTime": "2018-05-10T23:59:00+03:00", "type": "OnDemandPublication", "id": "4-6791573"}, {"publisher": [{"id": "tv-finland"}], "temporalStatus": "in-past", "service": {"id": "tv-finland"}, "tags": {"catalog": false}, "region": "Finland", "version": 1517315651, "startTime": "2005-10-19T20:00:30+03:00", "duration": "PT28M13S", "endTime": "2005-10-19T20:28:43+03:00", "type": "ScheduledTransmission", "id": "4-6306064"}, {"publisher": [{"id": "yle-tv2"}], "temporalStatus": "in-past", "service": {"id": "yle-tv2"}, "tags": {"catalog": false}, "region": "Finland", "version": 1517315651, "startTime": "2005-10-19T20:00:30+03:00", "duration": "PT28M13S", "endTime": "2005-10-19T20:28:43+03:00", "type": "ScheduledTransmission", "id": "4-6306063"}], "type": "TVProgram", "typeMedia": "TVContent", "description": {"fi": "1/12. Iina, pikkukaupungin suosituin ja kaunein lukiolaistytt\u00f6, p\u00e4\u00e4tt\u00e4\u00e4 antaa opetuksen poikakaverilleen. Suunnitelmalla on ik\u00e4v\u00e4t j\u00e4lkiseuraukset, Iina rakastuu aivan v\u00e4\u00e4r\u00e4\u00e4n tyyppiin. (2005)", "sv": "1/12: Iina, sm\u00e5stadens popul\u00e4raste och snyggaste gymnasisttjej best\u00e4mmer sig f\u00f6r att ge sin pojkv\u00e4n en l\u00e4xa. Planen f\u00e5r tr\u00e5kiga f\u00f6ljder; Iina blir k\u00e4r i alldeles fel typ. (2005)"}, "alternativeId": ["16-1-0234683"], "collection": "main", "longDescription": {"fi": "P\u00e4\u00e4rooleissa: Sara Melleri (Iina). Lasse Poser (Hemmo). Hanna Juvonen (Outi). Panu Mikkola (Make). Helena R\u00e4ngman (Helena). K\u00e4sikirjoittaja Harri Veistinen. Ohjaaja Jukka-Pekka Siili."}, "originalTitle": {}, "itemTitle": {"fi": "Erehdys", "sv": "Misstaget"}, "@id": "http://programs.api.yle.fi/v1/id/1-1303904", "partOfSeries": {"indexDataModified": "2017-08-30T09:27:45.415+03:00", "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "countryOfOrigin": [], "@id": "http://programs.api.yle.fi/v1/id/1-3802903", "image": {"available": true, "version": 1504074465, "type": "ImageObject", "id": "13-1-3802903"}, "creator": [], "season": [{"indexDataModified": "2017-12-15T10:00:47.921+02:00", "seasonNumber": 1, "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "countryOfOrigin": [], "creator": [], "productionId": "53753500000", "partOfSeries": {"id": "1-3802903"}, "type": "TVSeason", "id": "1-3794529", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-6", "notation": [{"valueType": "finnpanel-notation", "value": "5"}], "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "inScheme": "areena-content-classification", "key": "kotimaisetsarjat", "type": "Concept", "id": "5-133"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}]}], "coverImage": {"available": true, "version": 1504074465, "type": "ImageObject", "id": "13-1-3802903-cover"}, "type": "TVSeries", "id": "1-3802903", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-6", "notation": [{"valueType": "finnpanel-notation", "value": "5"}], "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "inScheme": "areena-content-classification", "key": "kotimaisetsarjat", "type": "Concept", "id": "5-133"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}]}, "countryOfOrigin": ["Suomi"], "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "audio": [{"type": "AudioTrack", "language": ["fi"], "format": [{"type": "Concept", "inScheme": "mediaformat-classification", "key": "stereo"}]}]}}}
DEBUG: media:
DEBUG: {"meta": {"mediaId": "1-1303904", "callback": "yleEmbed.startPlayerCallback", "instance": "1", "client": "areena-flash-player", "protocol": "HDS", "id": "6-043e4e240dc946d1b99f23216c472ac6"}, "data": {"media": {"HDS": [{"protocol": "HDS", "url": "JK8yiUV60gRY84LEBRAiF0I5YLN9gD5txmAk1NfDUgbdZrUcHfqqXAt+F6Gt5SgptXvVJ2tZgWwp38E4R6eDVEsp88lc7OgrmTUH48lGePMBdX12F6R4UCOcGFYZQGFgddwAXuh0fKythD+S9wF6jXKt4p2dkxatfvgZTLfLoSPXMp2pTho0zkfjXYO5iSRyuYdeHUXHT+xjxg6V0/7ZhOfd0Y10cOP068+I/QTB2xntnxuVutXq5CZGKGo+NFmHh1wvIrVbZmQIWOH3uUXGYusugjbRzjYn+E3tGMLdUZJDAfWxjgw7jgsd8fN8Q6a5hD45wf+QnJMlWG43y0n/+sH1HIsb2PxSgL/R1iYReZBmJPyagKns5Zg1EKQzxr5QhLCV5yRwoBCpPw==", "formatOf": "6-043e4e240dc946d1b99f23216c472ac6", "height": 396, "width": 704, "live": false, "type": "VideoObject", "multibitrate": true, "subtitles": [], "protectionType": "DEFAULT"}]}, "domain": {}}}
DEBUG: Available flavors: [{u'width': 224, u'bitrate': 213, u'height': 126}, {u'width': 480, u'bitrate': 461, u'height': 270}, {u'width': 640, u'bitrate': 750, u'height': 360}, {u'width': 704, u'bitrate': 1121, u'height': 396}]
DEBUG: max_height: None, max_bitrate: None
DEBUG: Selected flavor: {u'width': 704, u'height': 396, u'bitrate': 1121, u'mediaurl': u'3_2325019a40de5254_'}
DEBUG: Now trying downloader HDSDump
Output file: c:\Video\Rakastuin mä luuseriin_ S01E01_ Erehdys-2017-05-11T01_00.flv
DEBUG: Executing:
DEBUG: php c:\yle-dl-2.31\yledl\AdobeHDS.php --manifest https://areenahdfi-vh.akamaihd.net/z/fi/c8/c89ee65304c66f1faaaa090128af0471_,152576,407552,637952,1017856,.mp4.csmil/manifest.f4m?hdnea=st=1521490912~exp=1521491212~acl=/z/fi/c8/c89ee65304c66f1faaaa090128af0471_*~hmac=7fdee782c2efd8d6df76ea5f48e2ffe2efa29813434b8eabb0f00a517254dfca&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0 --quality 1121 --debug --delete --outfile c:\Video\Rakastuin mä luuseriin_ S01E01_ Erehdys-2017-05-11T01_00.flv
Traceback (most recent call last):
  File "c:\python2711\Scripts\yle-dl-script.py", line 9, in <module>
    load_entry_point('yle-dl==2.31', 'console_scripts', 'yle-dl')()
  File "build\bdist.win32\egg\yledl\yledl.py", line 366, in main
  File "build\bdist.win32\egg\yledl\yledl.py", line 234, in download
  File "build\bdist.win32\egg\yledl\downloaders.py", line 993, in download_episodes
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1040, in process
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1143, in process_single_episode
  File "build\bdist.win32\egg\yledl\downloaders.py", line 986, in download_clip
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2353, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2379, in _retry_call
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2338, in wrapped
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2105, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1886, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1910, in external_downloader
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1945, in execute
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1984, in start_process
  File "c:\python2711\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "c:\python2711\lib\subprocess.py", line 913, in _execute_child
    args = list2cmdline(args)
  File "c:\python2711\lib\subprocess.py", line 644, in list2cmdline
    return ''.join(result)
TypeError: sequence item 402: expected string, int found
DEBUG: not a playlist
DEBUG: program data:
DEBUG: {"meta": {"callback": "yleEmbed.programJsonpCallback", "id": "1-4023094"}, "data": {"metrics": {"sola": {"category": "draama", "contentLength": "4482012", "show": "draama.vod.vain_areenassa.miss\u00e4 on suuri pohjoinen", "contentType": "vod", "title": "20170511"}, "comscore": {"ns_st_ty": "vod", "yle_alternativeid": "16-1-0494049", "ns_st_el": "4482012", "ns_st_ep": "20170511", "ns_st_cl": "4482012", "fp_bd": "20170511", "ns_st_ci": "16-1-0494049", "yle_genreid": "7.1", "yle_category": "sarjatjaelokuvat;elokuvat", "category": "draama", "yle_title": "miss\u00e4 on suuri pohjoinen", "yle_truelength": "4482012", "ns_st_ge": "kotimaiset elokuvat", "yle_ss_ohjusid": "1-4023094", "ns_st_st": "vain_areenassa", "fp_clnr": "20001", "countername": "draama.vod.vain_areenassa.miss\u00e4 on suuri pohjoinen", "fp_ty": "video_tv_program", "yle_stickytitle": "miss\u00e4 on suuri pohjoinen", "yle_dayssincepublish": "312", "yle_language": "fi", "yle_ss_prodnumber": "44567801000", "ns_st_dt": "20170511", "fp_ch": "fp198", "content_type": "vod", "ns_st_pl": "draama.vod.vain_areenassa.miss\u00e4 on suuri pohjoinen.20170511", "yle_metrics_api_data_version": "v2.1", "yle_ss_mediaid": "6-acad485b0129445ea4818291fd1e168c", "fp_prod_id": "na", "ns_st_pr": "draama.vod.vain_areenassa.miss\u00e4 on suuri pohjoinen"}}, "program": {"creator": [], "image": {"available": true, "version": 1517315752, "type": "ImageObject", "id": "13-1-4023094"}, "productionId": "44567801000", "video": {"type": "VideoTrack", "language": [], "format": [{"type": "Concept", "inScheme": "mediaformat-classification", "key": "4:3"}]}, "duration": "PT1H14M42.480S", "id": "1-4023094", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-8", "notation": [{"valueType": "finnpanel-notation", "value": "7.1"}], "title": {"fi": "Kotimaiset elokuvat", "en": "Domestic Movies"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.10", "title": {"fi": "TV-elokuva"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Elokuvat", "sv": "Filmer"}, "inScheme": "areena-content-classification", "key": "elokuvat", "type": "Concept", "id": "5-135"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}], "indexDataModified": "2018-01-30T14:35:52.362+02:00", "typeCreative": "Program", "subtitling": [], "contentRating": {"ratingSystem": "MEKU", "reason": [{"type": "ContentRatingReason", "key": "anxiety", "title": {"fi": "Voi aiheuttaa ahdistusta", "en": "Content may cause anxiety", "sv": "Kan skapa \u00e5ngest"}}, {"type": "ContentRatingReason", "key": "violence", "title": {"fi": "Sis\u00e4lt\u00e4\u00e4 v\u00e4kivaltaa", "en": "Violent content", "sv": "V\u00e5ldsinslag"}}], "ageRestriction": 12, "type": "ContentRating", "title": {"fi": "Sallittu yli 12-vuotiaille", "en": "Not for persons under 12", "sv": "F\u00f6rbjudet under 12 \u00e5r"}}, "publicationEvent": [{"publisher": [{"id": "yle-areena"}], "temporalStatus": "currently", "service": {"id": "yle-areena"}, "tags": {"catalog": false}, "media": {"available": true, "contentProtection": [{"type": "ContentProtectionPolicy", "id": "22-1"}], "version": 1517315752, "downloadable": false, "duration": "PT1H14M42.012S", "type": "VideoObject", "id": "6-acad485b0129445ea4818291fd1e168c"}, "region": "Finland", "version": 1517315752, "startTime": "2017-05-11T04:00:00+03:00", "duration": "P11M4W1DT19H59M", "endTime": "2018-05-10T23:59:00+03:00", "type": "OnDemandPublication", "id": "4-6899364"}, {"publisher": [{"id": "yle-tv1"}], "temporalStatus": "in-past", "service": {"id": "yle-tv1"}, "tags": {"catalog": false}, "region": "Finland", "version": 1517315752, "startTime": "2004-07-19T21:26:08+03:00", "duration": "PT1H14M39S", "endTime": "2004-07-19T22:40:47+03:00", "type": "ScheduledTransmission", "id": "4-6745581"}, {"publisher": [{"id": "tv-finland"}], "temporalStatus": "in-past", "service": {"id": "tv-finland"}, "tags": {"catalog": false}, "region": "Finland", "version": 1517315752, "startTime": "2004-07-19T21:26:08+03:00", "duration": "PT1H14M39S", "endTime": "2004-07-19T22:40:47+03:00", "type": "ScheduledTransmission", "id": "4-6745580"}], "type": "TVProgram", "typeMedia": "TVContent", "description": {"fi": "Kaksi t\u00e4ysin erilaista ihmist\u00e4 kohtaa matkalla Helsingin L\u00e4nsisatamasta J\u00e4\u00e4merelle. K\u00e4sikirjoitus Rosa Liksom. Ohjaus Hannu Kahakorpi. (1991)", "sv": "Tv\u00e5 totalt olika m\u00e4nniskor m\u00f6ts p\u00e5 en resa fr\u00e5n V\u00e4stra hamnen i Helsingfors till Ishavet. Manus: Rosa Liksom. Regi: Hannu Kahakorpi. (1991)"}, "alternativeId": ["16-1-0494049"], "collection": "main", "longDescription": {"fi": "P\u00e4\u00e4rooleissa Outi Alanen (liftari) ja Paavo Pentik\u00e4inen (rekkakuski). K\u00e4sikirjoittaja Rosa Liksom. Ohjaaja Hannu Kahakorpi."}, "originalTitle": {}, "itemTitle": {"fi": "Miss\u00e4 on Suuri Pohjoinen", "sv": "Var \u00e4r den Stora Norden"}, "@id": "http://programs.api.yle.fi/v1/id/1-4023094", "countryOfOrigin": ["Suomi"], "title": {"fi": "Miss\u00e4 on Suuri Pohjoinen", "sv": "Var \u00e4r den Stora Norden"}, "audio": [{"type": "AudioTrack", "language": ["fi"], "format": [{"type": "Concept", "inScheme": "mediaformat-classification", "key": "stereo"}]}]}}}
DEBUG: media:
DEBUG: {"meta": {"mediaId": "1-4023094", "callback": "yleEmbed.startPlayerCallback", "instance": "1", "client": "areena-flash-player", "protocol": "HDS", "id": "6-acad485b0129445ea4818291fd1e168c"}, "data": {"media": {"HDS": [{"protocol": "HDS", "url": "sf0GuQ3yGjRONjLrBtGh+3zIrD9HpBdpUgXNcDnGhhmILBY7VwuCm/w9hcQ1gMWaylx7oLAZa0IyaWlcVtV6tX9d6pubwB4Ld84LXb7lSa/Zb0ZCB1f0AvXLebYVRC+WExQYWj7KIk5P+myKkKdd6veiNGg9WROE4YoUG1YarrbGnk2AmwLeuCvh7p+TguPO2au6IDVN0tnquyw0ZULzbMpqb4hc9gN5oHNXHG2xZItCdIpmc97s40qLvgU08sBEOQT6JFQgO0WjZJlLolvKZgf+UJ89aGVYPy5hW/Q923Fu4fHDvhF9VSQw5hQW92GIu4YlXWbtyov8N7r10L2LE8mQZA+NbGQtZlPSYyUpqyLAZuAc5QG7MTQvEXgHjlRev64sBlR25R3cyQ==", "formatOf": "6-acad485b0129445ea4818291fd1e168c", "height": 480, "width": 640, "live": false, "type": "VideoObject", "multibitrate": true, "subtitles": [], "protectionType": "DEFAULT"}]}, "domain": {}}}
DEBUG: Available flavors: [{u'width': 192, u'bitrate': 211, u'height': 144}, {u'width': 440, u'bitrate': 463, u'height': 330}, {u'width': 512, u'bitrate': 776, u'height': 384}, {u'width': 640, u'bitrate': 1111, u'height': 480}]
DEBUG: max_height: None, max_bitrate: None
DEBUG: Selected flavor: {u'width': 640, u'height': 480, u'bitrate': 1111, u'mediaurl': u'3_ef4e7ff97d86a8f0_'}
DEBUG: Now trying downloader HDSDump
Output file: c:\Video\Missä on Suuri Pohjoinen-2017-05-11T04_00.flv
DEBUG: Executing:
DEBUG: php c:\yle-dl-2.31\yledl\AdobeHDS.php --manifest https://areenahdfi-vh.akamaihd.net/z/fi/e4/e4ee565d6a69a9d9464765df1d8de891_,151552,409600,665600,1007616,.mp4.csmil/manifest.f4m?hdnea=st=1521490245~exp=1521490545~acl=/z/fi/e4/e4ee565d6a69a9d9464765df1d8de891_*~hmac=9ca793161080521dab10b984a5d04404a6bacea64bad89c2c334f6f8bdd5125d&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0 --quality 1111 --debug --delete --outfile c:\Video\Missä on Suuri Pohjoinen-2017-05-11T04_00.flv
Traceback (most recent call last):
  File "c:\python2711\Scripts\yle-dl-script.py", line 9, in <module>
    load_entry_point('yle-dl==2.31', 'console_scripts', 'yle-dl')()
  File "build\bdist.win32\egg\yledl\yledl.py", line 366, in main
  File "build\bdist.win32\egg\yledl\yledl.py", line 234, in download
  File "build\bdist.win32\egg\yledl\downloaders.py", line 993, in download_episodes
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1040, in process
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1143, in process_single_episode
  File "build\bdist.win32\egg\yledl\downloaders.py", line 986, in download_clip
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2353, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2379, in _retry_call
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2338, in wrapped
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2105, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1886, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1910, in external_downloader
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1945, in execute
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1984, in start_process
  File "c:\python2711\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "c:\python2711\lib\subprocess.py", line 913, in _execute_child
    args = list2cmdline(args)
  File "c:\python2711\lib\subprocess.py", line 644, in list2cmdline
    return ''.join(result)
TypeError: sequence item 402: expected string, int found

I didn't have youtube-dl installed, but I followed your instructions to install it. Thereafter using --backend youtubedl works for the otherwise failing urls. Thanks.

Nevertheless, if I can help/assist to get the default downloader AdobeHDS to work under Windows for the currently failing video urls, just let me know.

utelle commented 6 years ago

Unfortunately my command of Python isn't very high. Nevertheless, I added a few extra lines for debugging to downloaders.py to show the command arguments args and the encoded arguments encoded_args. Following is the extra debug output:

DEBUG: Args: [u'php', u'c:\\yle-dl-2.31\\yledl\\AdobeHDS.php', u'--manifest', u'https://areenahdfi-vh.akamaihd.net/z/fi/c8/c89ee65304c66f1faaaa090128af0471_,152576,407552,637952,1017856,.mp4.csmil/manifest.f4m?hdnea=st=1521624268~exp=1521624568~acl=/z/fi/c8/c89ee65304c66f1faaaa090128af0471_*~hmac=e1c0268b5356cc35909a991d83e92c14a6d426dbbfa0d8894e64ac1951ad252e&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0', u'--quality', '1121', u'--debug', u'--delete', u'--outfile', u'd:\\Video\\Rakastuin m\xe4 luuseriin_ S01E01_ Erehdys-2017-05-11T01_00.flv']
DEBUG: Encoded args: ['php', 'c:\\yle-dl-2.31\\yledl\\AdobeHDS.php', '--manifest', 'https://areenahdfi-vh.akamaihd.net/z/fi/c8/c89ee65304c66f1faaaa090128af0471_,152576,407552,637952,1017856,.mp4.csmil/manifest.f4m?hdnea=st=1521624268~exp=1521624568~acl=/z/fi/c8/c89ee65304c66f1faaaa090128af0471_*~hmac=e1c0268b5356cc35909a991d83e92c14a6d426dbbfa0d8894e64ac1951ad252e&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0', '--quality', b'1121', '--debug', '--delete', '--outfile', 'd:\\Video\\Rakastuin m\xe4 luuseriin_ S01E01_ Erehdys-2017-05-11T01_00.flv']

As far as I can tell the numeric parameter 1121 following after --quality is causing the problem. While all other strings in args have a u prefix, the numeric parameter has not. And in encoded_args all strings don't have a prefix anymore, except for the numeric parameter, now having the prefix b.

It seems it is necessary to force the numeric parameter to the right string type.

utelle commented 6 years ago

In the meantime I did some further experiments. Finally, I added in method start_process in downloaders.py one line before line 1979 to force all elements of args to unicode and then used args2 to build encoded_args:

args2 = [unicode(x) for x in args]
encoded_args = [x.encode(enc, 'replace') for x in args2]

I tested this with several previously failing video urls ... and it worked.

Maybe there exists a more elegant solution, though.

aajanki commented 6 years ago

Thanks for debugging this further! I'll try to come up with a patch that is compatible also with Python 3. I will also try to understand why the current code is broken on Windows. The quality parameter is correctly created as a unicode string on Python 2.7 on Linux.

utelle commented 6 years ago

I tried to check whether the same problem shows up when using python 3. However, I failed to install the pre-requisite pycrypto, and I didn't find a pre-compiled package for python 3.6.4. I tried to replace pycrypto by pycryptodome, but probably I did it in a too naive way, because yle-dl failed to run.

For the time being I can live with my workaround, but I'm looking forward to an updated version of yle-dl which works out of the box. Thanks for your great work!

hugovk commented 6 years ago

Pycrypto is dead:

https://github.com/dlitz/pycrypto/issues/238

It's probably worth updating yle-dl to use Pycrypto dome, "an almost drop-in replacement".

aajanki commented 6 years ago

I modified yle-dl to use pycryptodome. @utelle, can you try again on Python 3?

I still haven't had time to look into what is causing the issue on Python 2.

utelle commented 6 years ago

I struggled a bit with installing pycryptodomex, but after using the additional switch --use-wheel I managed to install it. Then I started a test using the following command line

c:\tools\python364\Scripts\yle-dl --verbose --vfat --sublang all --maxbitrate best --adobehds "php c:\yle-dl-2.31\yledl\AdobeHDS.php" --wget c:\yle-dl-2.31\yledl\wget.exe --ffmpeg c:\yle-dl-2.31\yledl\ffmpeg.exe --ffprobe c:\yle-dl-2.31\yledl\ffprobe.exe --rtmpdump c:\yle-dl-2.31\yledl\rtmpdump.exe --destdir c:\Video\Test https://areena.yle.fi/1-1890998

But I got the following error trace back:

Traceback (most recent call last):
  File "c:\tools\python364\Scripts\yle-dl-script.py", line 11, in <module>
    load_entry_point('yle-dl==2.31', 'console_scripts', 'yle-dl')()
  File "c:\tools\python364\lib\site-packages\pkg_resources\__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "c:\tools\python364\lib\site-packages\pkg_resources\__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "c:\tools\python364\lib\site-packages\pkg_resources\__init__.py", line 2291, in load
    return self.resolve()
  File "c:\tools\python364\lib\site-packages\pkg_resources\__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\__init__.py", line 2, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\yledl.py", line 36, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 28, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\hds.py", line 5, in <module>
  File "c:\tools\python364\lib\site-packages\py3amf-0.8.7-py3.6.egg\pyamf\__init__.py", line 16, in <module>
    from pyamf import util, _version
  File "c:\tools\python364\lib\site-packages\py3amf-0.8.7-py3.6.egg\pyamf\util\__init__.py", line 217, in <module>
    datetime.datetime.utcfromtimestamp(-31536000.0)
OSError: [Errno 22] Invalid argument

A different error than before ... however, I have no clue what's causing it and how to fix it.

aajanki commented 6 years ago

That seems to be a bug in the pyamf library (only on Python3 and Windows?). Pyamf has also other issues, and I have anyway been planning to replace it with another library.

utelle commented 6 years ago

I inspected the code in pyamf\util\__init__.py and it is exactly the call to datetime.datetime.utcfromtimestamp(-31536000.0). It is within a try-block to detect broken handling of negative timestamps. Obviously the call to utcfromtimestamp throws an unhandled os exception. I guess the pyamf developers would have to fix this somehow.

Googling shows that this seems to be a known problem/bug. No idea why this problem shows up under Windows only.

gunnar12 commented 6 years ago

problem shows up under Windows only./

Been trying, now and then, to compile, convert lates yle-dl to windows exe. Always getting stuck on something, was easier a year or two ago.

Any chance you "more skilled" could make your method, tools, etc public?? At least some hints??

PS My problem I dont really understand all that init, cfg, import, methods,objects of Python. Been doing simple embedded assembly most of my life

aajanki commented 6 years ago

I switched from pyamf to another AMF library (or rather, a fork of pyamf). Seems to me that the new library, doesn't have the issue with datetime.datetime.utcfromtimestamp(-31536000.0), but I haven't tested it on Windows and there might be other issues.

utelle commented 6 years ago

Unfortunately, it didn't work under Windows - neither with Python 2.7 nor with Python 3.6. However, the errors are different depending on the Python version. No idea whether the errors are related to AMF or not. Please see the debug logs below.

I used the following test command line invocation:

yle-dl --verbose --vfat --sublang all --maxbitrate best --adobehds "php c:\yle-dl-2.31\yledl\AdobeHDS.php" --wget c:\yle-dl-2.31\yledl\wget.exe --ffmpeg c:\yle-dl-2.31\yledl\ffmpeg.exe --ffprobe c:\yle-dl-2.31\yledl\ffprobe.exe --rtmpdump c:\yle-dl-2.31\yledl\rtmpdump.exe --destdir c:\Video\Test https://areena.yle.fi/1-1890998

Debug output from Python 2.7 version:

DEBUG: not a playlist
DEBUG: program data:
DEBUG: {"meta": {"callback": "yleEmbed.programJsonpCallback", "id": "1-1890998"}, "data": {"metrics": {"sola": {"category": "draama", "contentLength": "1711000", "show": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin", "contentType": "vod", "title": "20170511.4"}, "comscore": {"ns_st_ty": "vod", "yle_alternativeid": "16-1-0234686", "ns_st_el": "1711000", "ns_st_ep": "20170511.4", "ns_st_cl": "1711000", "fp_bd": "20170510", "ns_st_ci": "16-1-0234686", "yle_genreid": "5", "yle_category": "sarjatjaelokuvat;kotimaisetsarjat", "category": "draama", "yle_title": "rakastuin m\u00e4 luuseriin", "yle_truelength": "1711000", "ns_st_ge": "kotimainen fiktio", "yle_ss_ohjusid": "1-1890998", "ns_st_st": "vain_areenassa", "fp_clnr": "20001", "countername": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin", "fp_ty": "video_tv_program", "yle_stickytitle": "rakastuin m\u00e4 luuseriin", "yle_dayssincepublish": "329", "yle_language": "fi", "yle_ss_prodnumber": "53753504000", "ns_st_dt": "20170511", "fp_ch": "fp198", "content_type": "vod", "ns_st_pl": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin.20170511.4", "yle_metrics_api_data_version": "v2.1", "yle_ss_mediaid": "6-858fe702aadd45c5bd97266926bb7b54", "fp_prod_id": "na", "ns_st_pr": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin"}}, "program": {"creator": [], "image": {"available": true, "version": 1517315651, "type": "ImageObject", "id": "13-1-1890998"}, "productionId": "53753504000", "video": {"type": "VideoTrack", "language": [], "format": [{"type": "Concept", "inScheme": "mediaformat-classification", "key": "16:9"}]}, "duration": "PT28M31S", "id": "1-1890998", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-6", "notation": [{"valueType": "finnpanel-notation", "value": "5"}], "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "inScheme": "areena-content-classification", "key": "kotimaisetsarjat", "type": "Concept", "id": "5-133"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}], "indexDataModified": "2018-01-30T14:34:11.949+02:00", "episodeNumber": 4, "typeCreative": "Program", "subtitling": [], "partOfSeason": {"indexDataModified": "2017-12-15T10:00:47.921+02:00", "seasonNumber": 1, "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "countryOfOrigin": [], "creator": [], "productionId": "53753500000", "partOfSeries": {"id": "1-3802903"}, "type": "TVSeason", "id": "1-3794529", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-6", "notation": [{"valueType": "finnpanel-notation", "value": "5"}], "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "inScheme": "areena-content-classification", "key": "kotimaisetsarjat", "type": "Concept", "id": "5-133"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}]}, "contentRating": {"ratingSystem": "MEKU", "reason": [{"type": "ContentRatingReason", "key": "sex", "title": {"fi": "Sis\u00e4lt\u00e4\u00e4 seksi\u00e4", "en": "Sexual content", "sv": "Sexuellt inneh\u00e5ll"}}, {"type": "ContentRatingReason", "key": "violence", "title": {"fi": "Sis\u00e4lt\u00e4\u00e4 v\u00e4kivaltaa", "en": "Violent content", "sv": "V\u00e5ldsinslag"}}], "ageRestriction": 7, "type": "ContentRating", "title": {"fi": "Sallittu yli 7-vuotiaille", "en": "Not for persons under 7", "sv": "F\u00f6rbjudet under 7 \u00e5r"}}, "publicationEvent": [{"publisher": [{"id": "yle-areena"}], "temporalStatus": "currently", "service": {"id": "yle-areena"}, "tags": {"catalog": true}, "media": {"available": true, "contentProtection": [{"type": "ContentProtectionPolicy", "id": "22-1"}], "version": 1517315651, "downloadable": false, "duration": "PT28M31S", "type": "VideoObject", "id": "6-858fe702aadd45c5bd97266926bb7b54"}, "region": "Finland", "version": 1517315651, "startTime": "2017-05-11T01:00:00+03:00", "duration": "P11M4W1DT22H59M", "endTime": "2018-05-10T23:59:00+03:00", "type": "OnDemandPublication", "id": "4-6791583"}, {"publisher": [{"id": "tv-finland"}], "temporalStatus": "in-past", "service": {"id": "tv-finland"}, "tags": {"catalog": false}, "region": "Finland", "version": 1517315651, "startTime": "2005-11-09T20:00:17+02:00", "duration": "PT28M31S", "endTime": "2005-11-09T20:28:48+02:00", "type": "ScheduledTransmission", "id": "4-6324149"}, {"publisher": [{"id": "yle-tv2"}], "temporalStatus": "in-past", "service": {"id": "yle-tv2"}, "tags": {"catalog": false}, "region": "Finland", "version": 1517315651, "startTime": "2005-11-09T20:00:17+02:00", "duration": "PT28M31S", "endTime": "2005-11-09T20:28:48+02:00", "type": "ScheduledTransmission", "id": "4-6324150"}], "type": "TVProgram", "typeMedia": "TVContent", "description": {"fi": "4/12. Outi kirjoittaa Iinalle tunnustuskirjeen - tai useampia versioita siit\u00e4, ennen kuin uskaltaa kertoa todellisen totuuden. Vai jatkuuko juonittelu sittenkin? (2005)", "sv": "4/12. Outi skriver ett bek\u00e4nnelsebrev till Iina - eller flera versioner av det, innan hon v\u00e5gar avsl\u00f6ja sanningen. Eller forts\u00e4tter intrigerandet trots allt? (2005)"}, "alternativeId": ["16-1-0234686"], "collection": "main", "longDescription": {"fi": "P\u00e4\u00e4rooleissa: Sara Melleri (Iina). Lasse Poser (Hemmo). Hanna Juvonen (Outi). Panu Mikkola (Make). Helena R\u00e4ngman (Helena). K\u00e4sikirjoittaja Harri Veistinen. Ohjaaja Jukka-Pekka Siili."}, "originalTitle": {}, "itemTitle": {"fi": "V\u00e4\u00e4r\u00e4 tunne"}, "@id": "http://programs.api.yle.fi/v1/id/1-1890998", "partOfSeries": {"indexDataModified": "2018-03-26T12:02:43.959+03:00", "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "countryOfOrigin": [], "@id": "http://programs.api.yle.fi/v1/id/1-3802903", "image": {"available": true, "version": 1522054963, "type": "ImageObject", "id": "13-1-3802903"}, "creator": [], "season": [{"indexDataModified": "2017-12-15T10:00:47.921+02:00", "seasonNumber": 1, "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "countryOfOrigin": [], "creator": [], "productionId": "53753500000", "partOfSeries": {"id": "1-3802903"}, "type": "TVSeason", "id": "1-3794529", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-6", "notation": [{"valueType": "finnpanel-notation", "value": "5"}], "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "inScheme": "areena-content-classification", "key": "kotimaisetsarjat", "type": "Concept", "id": "5-133"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}]}], "coverImage": {"available": true, "version": 1522054963, "type": "ImageObject", "id": "13-1-3802903-cover"}, "type": "TVSeries", "id": "1-3802903", "subject": [{"type": "Concept", "inScheme": "finnpanel-genre-classification", "id": "21-6", "notation": [{"valueType": "finnpanel-notation", "value": "5"}], "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}}, {"type": "Concept", "inScheme": "yle-content-main-classification", "id": "31-1-8", "title": {"fi": "Draama"}}, {"type": "Concept", "inScheme": "yle-content-format-classification", "id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}}, {"type": "Concept", "inScheme": "yle-content-topic-classification", "id": "31-3-8.79", "title": {"fi": "Nykydraama"}}, {"broader": {"id": "5-130"}, "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "inScheme": "areena-content-classification", "key": "sarjatjaelokuvat", "type": "Concept", "id": "5-131"}, {"broader": {"id": "5-131"}, "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "inScheme": "areena-content-classification", "key": "kotimaisetsarjat", "type": "Concept", "id": "5-133"}, {"type": "Concept", "inScheme": "areena-analytics-classification", "id": "5-262", "key": "draama", "title": {"fi": "Draama"}}]}, "countryOfOrigin": ["Suomi"], "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "audio": [{"type": "AudioTrack", "language": ["fi"], "format": [{"type": "Concept", "inScheme": "mediaformat-classification", "key": "stereo"}]}]}}}
DEBUG: media:
DEBUG: {"meta": {"mediaId": "1-1890998", "callback": "yleEmbed.startPlayerCallback", "instance": "1", "client": "areena-flash-player", "protocol": "HDS", "id": "6-858fe702aadd45c5bd97266926bb7b54"}, "data": {"media": {"HDS": [{"protocol": "HDS", "url": "eKXqeLJlfHhv9+CRSgoRjst8WZwvBWmi3zYzudXwjC816hRG8f+1H89icrmm8Ri9PYw3GGqHwfcfchoP8UJGJeoIeFKXmM1lnvkb+Fj2Lc53KWbc204fhQaFxLu/LnI0+CCxNvx4SF2XuR96i0vkI1ySC5NMpbcTpSZwBdHTS5+hvsXdG+2zh5/EG0LlL+vuivV+I6GwFB8tpW1O1U+fLw24M2HXi011T4ppySLZpoVR6dlUftcnPVz/iWB4Ek4E9WYhMfpK5ZzwNhZuynZDXrivAVFusJAKjHTucuf9FFqAITaCSAUeocvbQMGdHBiJxsaNMk5m5CuBtwUuXJTfn1EBAxSDHpgUZV19/SbPnTLO9EUC6Xt4AK1RuGqkf9jAJDk/W+y9yCAP6Q==", "formatOf": "6-858fe702aadd45c5bd97266926bb7b54", "height": 396, "width": 704, "live": false, "type": "VideoObject", "multibitrate": true, "subtitles": [], "protectionType": "DEFAULT"}]}, "domain": {}}}
DEBUG: Media URL: https://areenahdfi-vh.akamaihd.net/z/fi/57/575bd269141139e698debdd3a8678998_,152576,393216,644096,1018880,.mp4.csmil/manifest.f4m?hdnea=st=1522880608~exp=1522880908~acl=/z/fi/57/575bd269141139e698debdd3a8678998_*~hmac=54db69eb827680e493d23cc9685a0d9a09ffb7475b136b84f7d8a42da8cf9271&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0
DEBUG: Available flavors: [{u'width': 224, u'bitrate': 213, u'height': 126}, {u'width': 480, u'bitrate': 448, u'height': 270}, {u'width': 640, u'bitrate': 756, u'height': 360}, {u'width': 704, u'bitrate': 1121, u'height': 396}]
DEBUG: max_height: None, max_bitrate: None
DEBUG: Selected flavor: {u'width': 704, u'height': 396, u'bitrate': 1121, u'mediaurl': u'3_2325019a40de5254_'}
DEBUG: Now trying downloader HDSDump
Output file: c:\Video\Test\Rakastuin mä luuseriin_ S01E04_ Väärä tunne-2017-05-11T01_00.flv
DEBUG: Executing:
DEBUG: php c:\yle-dl-2.31\yledl\AdobeHDS.php --manifest https://areenahdfi-vh.akamaihd.net/z/fi/57/575bd269141139e698debdd3a8678998_,152576,393216,644096,1018880,.mp4.csmil/manifest.f4m?hdnea=st=1522880608~exp=1522880908~acl=/z/fi/57/575bd269141139e698debdd3a8678998_*~hmac=54db69eb827680e493d23cc9685a0d9a09ffb7475b136b84f7d8a42da8cf9271&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0 --quality 1121 --debug --delete --outfile c:\Video\Test\Rakastuin mä luuseriin_ S01E04_ Väärä tunne-2017-05-11T01_00.flv
Traceback (most recent call last):
  File "c:\tools\python2711\Scripts\yle-dl-script.py", line 9, in <module>
    load_entry_point('yle-dl==2.31', 'console_scripts', 'yle-dl')()
  File "build\bdist.win32\egg\yledl\yledl.py", line 379, in main
  File "build\bdist.win32\egg\yledl\yledl.py", line 247, in download
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1008, in download_episodes
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1055, in process
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1158, in process_single_episode
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1001, in download_clip
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2373, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2399, in _retry_call
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2358, in wrapped
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2125, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1906, in save_stream
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1930, in external_downloader
  File "build\bdist.win32\egg\yledl\downloaders.py", line 1965, in execute
  File "build\bdist.win32\egg\yledl\downloaders.py", line 2004, in start_process
  File "c:\tools\python2711\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "c:\tools\python2711\lib\subprocess.py", line 913, in _execute_child
    args = list2cmdline(args)
  File "c:\tools\python2711\lib\subprocess.py", line 644, in list2cmdline
    return ''.join(result)
TypeError: sequence item 406: expected string, int found

Debug output from Python 3.6 version:

DEBUG: not a playlist
DEBUG: program data:
DEBUG: {"meta": {"id": "1-1890998", "callback": "yleEmbed.programJsonpCallback"}, "data": {"program": {"typeMedia": "TVContent", "subject": [{"id": "21-6", "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}, "inScheme": "finnpanel-genre-classification", "type": "Concept", "notation": [{"value": "5", "valueType": "finnpanel-notation"}]}, {"id": "31-1-8", "title": {"fi": "Draama"}, "inScheme": "yle-content-main-classification", "type": "Concept"}, {"id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}, "inScheme": "yle-content-format-classification", "type": "Concept"}, {"id": "31-3-8.79", "title": {"fi": "Nykydraama"}, "inScheme": "yle-content-topic-classification", "type": "Concept"}, {"id": "5-131", "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "broader": {"id": "5-130"}, "inScheme": "areena-content-classification", "type": "Concept", "key": "sarjatjaelokuvat"}, {"id": "5-133", "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "broader": {"id": "5-131"}, "inScheme": "areena-content-classification", "type": "Concept", "key": "kotimaisetsarjat"}, {"id": "5-262", "title": {"fi": "Draama"}, "inScheme": "areena-analytics-classification", "type": "Concept", "key": "draama"}], "collection": "main", "episodeNumber": 4, "type": "TVProgram", "creator": [], "id": "1-1890998", "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "description": {"fi": "4/12. Outi kirjoittaa Iinalle tunnustuskirjeen - tai useampia versioita siit\u00e4, ennen kuin uskaltaa kertoa todellisen totuuden. Vai jatkuuko juonittelu sittenkin? (2005)", "sv": "4/12. Outi skriver ett bek\u00e4nnelsebrev till Iina - eller flera versioner av det, innan hon v\u00e5gar avsl\u00f6ja sanningen. Eller forts\u00e4tter intrigerandet trots allt? (2005)"}, "longDescription": {"fi": "P\u00e4\u00e4rooleissa: Sara Melleri (Iina). Lasse Poser (Hemmo). Hanna Juvonen (Outi). Panu Mikkola (Make). Helena R\u00e4ngman (Helena). K\u00e4sikirjoittaja Harri Veistinen. Ohjaaja Jukka-Pekka Siili."}, "originalTitle": {}, "itemTitle": {"fi": "V\u00e4\u00e4r\u00e4 tunne"}, "video": {"language": [], "format": [{"inScheme": "mediaformat-classification", "type": "Concept", "key": "16:9"}], "type": "VideoTrack"}, "countryOfOrigin": ["Suomi"], "productionId": "53753504000", "alternativeId": ["16-1-0234686"], "audio": [{"language": ["fi"], "format": [{"inScheme": "mediaformat-classification", "type": "Concept", "key": "stereo"}], "type": "AudioTrack"}], "image": {"id": "13-1-1890998", "available": true, "type": "ImageObject", "version": 1517315651}, "subtitling": [], "typeCreative": "Program", "duration": "PT28M31S", "contentRating": {"title": {"fi": "Sallittu yli 7-vuotiaille", "sv": "F\u00f6rbjudet under 7 \u00e5r", "en": "Not for persons under 7"}, "ageRestriction": 7, "reason": [{"title": {"fi": "Sis\u00e4lt\u00e4\u00e4 seksi\u00e4", "sv": "Sexuellt inneh\u00e5ll", "en": "Sexual content"}, "type": "ContentRatingReason", "key": "sex"}, {"title": {"fi": "Sis\u00e4lt\u00e4\u00e4 v\u00e4kivaltaa", "sv": "V\u00e5ldsinslag", "en": "Violent content"}, "type": "ContentRatingReason", "key": "violence"}], "ratingSystem": "MEKU", "type": "ContentRating"}, "indexDataModified": "2018-01-30T14:34:11.949+02:00", "@id": "http://programs.api.yle.fi/v1/id/1-1890998", "partOfSeries": {"id": "1-3802903", "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "subject": [{"id": "21-6", "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}, "inScheme": "finnpanel-genre-classification", "type": "Concept", "notation": [{"value": "5", "valueType": "finnpanel-notation"}]}, {"id": "31-1-8", "title": {"fi": "Draama"}, "inScheme": "yle-content-main-classification", "type": "Concept"}, {"id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}, "inScheme": "yle-content-format-classification", "type": "Concept"}, {"id": "31-3-8.79", "title": {"fi": "Nykydraama"}, "inScheme": "yle-content-topic-classification", "type": "Concept"}, {"id": "5-131", "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "broader": {"id": "5-130"}, "inScheme": "areena-content-classification", "type": "Concept", "key": "sarjatjaelokuvat"}, {"id": "5-133", "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "broader": {"id": "5-131"}, "inScheme": "areena-content-classification", "type": "Concept", "key": "kotimaisetsarjat"}, {"id": "5-262", "title": {"fi": "Draama"}, "inScheme": "areena-analytics-classification", "type": "Concept", "key": "draama"}], "image": {"id": "13-1-3802903", "available": true, "type": "ImageObject", "version": 1522054963}, "type": "TVSeries", "coverImage": {"id": "13-1-3802903-cover", "available": true, "type": "ImageObject", "version": 1522054963}, "countryOfOrigin": [], "creator": [], "indexDataModified": "2018-03-26T12:02:43.959+03:00", "@id": "http://programs.api.yle.fi/v1/id/1-3802903", "season": [{"id": "1-3794529", "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "productionId": "53753500000", "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "subject": [{"id": "21-6", "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}, "inScheme": "finnpanel-genre-classification", "type": "Concept", "notation": [{"value": "5", "valueType": "finnpanel-notation"}]}, {"id": "31-1-8", "title": {"fi": "Draama"}, "inScheme": "yle-content-main-classification", "type": "Concept"}, {"id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}, "inScheme": "yle-content-format-classification", "type": "Concept"}, {"id": "31-3-8.79", "title": {"fi": "Nykydraama"}, "inScheme": "yle-content-topic-classification", "type": "Concept"}, {"id": "5-131", "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "broader": {"id": "5-130"}, "inScheme": "areena-content-classification", "type": "Concept", "key": "sarjatjaelokuvat"}, {"id": "5-133", "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "broader": {"id": "5-131"}, "inScheme": "areena-content-classification", "type": "Concept", "key": "kotimaisetsarjat"}, {"id": "5-262", "title": {"fi": "Draama"}, "inScheme": "areena-analytics-classification", "type": "Concept", "key": "draama"}], "partOfSeries": {"id": "1-3802903"}, "seasonNumber": 1, "type": "TVSeason", "countryOfOrigin": [], "creator": [], "indexDataModified": "2017-12-15T10:00:47.921+02:00"}]}, "partOfSeason": {"id": "1-3794529", "title": {"fi": "Rakastuin m\u00e4 luuseriin", "sv": "K\u00e4r i en loser"}, "productionId": "53753500000", "description": {"fi": "Jos joku rakastuu luuseriin, yksi kertoja tarinalle ei riit\u00e4. 12-osainen draamakomedia vuodelta 2005 on viiden nuoren tarina, viidest\u00e4 eri n\u00e4k\u00f6kulmasta. N\u00f6rtit ja omituiset kohtaavat kauniit ja suositut. Iina, Hemmo, Make, Helena ja Outi ovat keskell\u00e4 rakastumisia ja romahduksia. Kostoa, juonia ja tunnustuksia. Siin\u00e4 sivussa v\u00e4h\u00e4n ruotsia, armeijaa ja abivuotta. Sarja on TV2 Draaman tuotanto.", "sv": "Om n\u00e5gon blir k\u00e4r i en loser, r\u00e4cker det inte med en person f\u00f6r att ber\u00e4tta historien. Den tolvdelade dramakomedin fr\u00e5n \u00e5r 2005 ber\u00e4ttar fem ungdomars historia ur fem olika synvinklar. N\u00f6rdar och kufar m\u00f6ter de vackra och de popul\u00e4ra. Iina, Hemmo, Make, Helena och Outi lever i f\u00f6r\u00e4lskelsernas och sammanbrottens berg-och-dalbana. Vid sidan om blir det lite svenska, arm\u00e9grejer och abi\u00e5r. Serien \u00e4r producerad av TV2 Drama."}, "subject": [{"id": "21-6", "title": {"fi": "Kotimainen fiktio", "en": "Domestic Fiction"}, "inScheme": "finnpanel-genre-classification", "type": "Concept", "notation": [{"value": "5", "valueType": "finnpanel-notation"}]}, {"id": "31-1-8", "title": {"fi": "Draama"}, "inScheme": "yle-content-main-classification", "type": "Concept"}, {"id": "31-2-8.11", "title": {"fi": "Fiktiosarja"}, "inScheme": "yle-content-format-classification", "type": "Concept"}, {"id": "31-3-8.79", "title": {"fi": "Nykydraama"}, "inScheme": "yle-content-topic-classification", "type": "Concept"}, {"id": "5-131", "title": {"fi": "Sarjat ja elokuvat", "sv": "Serier och film"}, "broader": {"id": "5-130"}, "inScheme": "areena-content-classification", "type": "Concept", "key": "sarjatjaelokuvat"}, {"id": "5-133", "title": {"fi": "Kotimaiset sarjat", "sv": "Inhemska serier"}, "broader": {"id": "5-131"}, "inScheme": "areena-content-classification", "type": "Concept", "key": "kotimaisetsarjat"}, {"id": "5-262", "title": {"fi": "Draama"}, "inScheme": "areena-analytics-classification", "type": "Concept", "key": "draama"}], "partOfSeries": {"id": "1-3802903"}, "seasonNumber": 1, "type": "TVSeason", "countryOfOrigin": [], "creator": [], "indexDataModified": "2017-12-15T10:00:47.921+02:00"}, "publicationEvent": [{"tags": {"catalog": true}, "startTime": "2017-05-11T01:00:00+03:00", "region": "Finland", "id": "4-6791583", "duration": "P11M4W1DT22H59M", "service": {"id": "yle-areena"}, "endTime": "2018-05-10T23:59:00+03:00", "type": "OnDemandPublication", "media": {"id": "6-858fe702aadd45c5bd97266926bb7b54", "duration": "PT28M31S", "contentProtection": [{"id": "22-1", "type": "ContentProtectionPolicy"}], "available": true, "type": "VideoObject", "downloadable": false, "version": 1517315651}, "publisher": [{"id": "yle-areena"}], "version": 1517315651, "temporalStatus": "currently"}, {"tags": {"catalog": false}, "startTime": "2005-11-09T20:00:17+02:00", "region": "Finland", "id": "4-6324149", "duration": "PT28M31S", "service": {"id": "tv-finland"}, "endTime": "2005-11-09T20:28:48+02:00", "type": "ScheduledTransmission", "publisher": [{"id": "tv-finland"}], "version": 1517315651, "temporalStatus": "in-past"}, {"tags": {"catalog": false}, "startTime": "2005-11-09T20:00:17+02:00", "region": "Finland", "id": "4-6324150", "duration": "PT28M31S", "service": {"id": "yle-tv2"}, "endTime": "2005-11-09T20:28:48+02:00", "type": "ScheduledTransmission", "publisher": [{"id": "yle-tv2"}], "version": 1517315651, "temporalStatus": "in-past"}]}, "metrics": {"comscore": {"ns_st_pr": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin", "ns_st_ep": "20170511.4", "ns_st_pl": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin.20170511.4", "ns_st_dt": "20170511", "ns_st_ty": "vod", "ns_st_st": "vain_areenassa", "countername": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin", "content_type": "vod", "yle_dayssincepublish": "329", "yle_language": "fi", "yle_ss_mediaid": "6-858fe702aadd45c5bd97266926bb7b54", "yle_ss_ohjusid": "1-1890998", "yle_ss_prodnumber": "53753504000", "yle_title": "rakastuin m\u00e4 luuseriin", "yle_stickytitle": "rakastuin m\u00e4 luuseriin", "category": "draama", "ns_st_cl": "1711000", "ns_st_el": "1711000", "yle_truelength": "1711000", "ns_st_ci": "16-1-0234686", "yle_metrics_api_data_version": "v2.1", "fp_bd": "20170510", "fp_ty": "video_tv_program", "fp_clnr": "20001", "fp_prod_id": "na", "fp_ch": "fp198", "ns_st_ge": "kotimainen fiktio", "yle_genreid": "5", "yle_alternativeid": "16-1-0234686", "yle_category": "sarjatjaelokuvat;kotimaisetsarjat"}, "sola": {"title": "20170511.4", "category": "draama", "show": "draama.vod.vain_areenassa.rakastuin m\u00e4 luuseriin", "contentLength": "1711000", "contentType": "vod"}}}}
DEBUG: media:
DEBUG: {"meta": {"instance": "1", "callback": "yleEmbed.startPlayerCallback", "id": "6-858fe702aadd45c5bd97266926bb7b54", "client": "areena-flash-player", "mediaId": "1-1890998", "protocol": "HDS"}, "data": {"media": {"HDS": [{"formatOf": "6-858fe702aadd45c5bd97266926bb7b54", "type": "VideoObject", "protectionType": "DEFAULT", "url": "zjLLEH8K5C62YXiWI31EhxQH+vxi0QXXxEmZ4iKuKTHoavNBUdw56mb2T4tf/2blXytIWJGCTHCgX5t+T/V25BUOxhMNK7FRN0uqTpg1ee67y1jY7Wl/aElGhQS9I0Cj0/Mn54C+hflT+Mcq5dVs9dVefFUhzuiWSSv/IMrsAhiKWwWoZR1KVm19hiq9+MsLULGLCeRl/6lsToXJ6ObZV1Aq/aWMUxQra+t7F440+Hg/QE2/vWYsXJaGppt1fseJaBOQAh4wHE/e0WVVdcFt+Uc7VrZpZnnwzn04Cst5nHo9+ucPLfk76SoMOtcoHBtbySg0IvMnBUDDxZexb21R1Q7xcUULdlvAfzhH3uTEGVUIuods2cIg2X/DAtVueEYTFxFfHAW0T9chaw==", "subtitles": [], "protocol": "HDS", "live": false, "width": 704, "height": 396, "multibitrate": true}]}, "domain": {}}}
DEBUG: Media URL: https://areenahdfi-vh.akamaihd.net/z/fi/57/575bd269141139e698debdd3a8678998_,152576,393216,644096,1018880,.mp4.csmil/manifest.f4m?hdnea=st=1522880120~exp=1522880420~acl=/z/fi/57/575bd269141139e698debdd3a8678998_*~hmac=a1ab0a0f71e20128b15627b6a1b7e8adeb162d51143e71d54d9fe7c5854bd961&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0
ERROR: Can't read https://areenahdfi-vh.akamaihd.net/z/fi/57/575bd269141139e698debdd3a8678998_,152576,393216,644096,1018880,.mp4.csmil/manifest.f4m?hdnea=st=1522880120~exp=1522880420~acl=/z/fi/57/575bd269141139e698debdd3a8678998_*~hmac=a1ab0a0f71e20128b15627b6a1b7e8adeb162d51143e71d54d9fe7c5854bd961&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0
Traceback (most recent call last):
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 117, in http_get
    r.raise_for_status()
  File "c:\tools\python364\lib\site-packages\requests-2.18.4-py3.6.egg\requests\models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://areenahdfi-vh.akamaihd.net/z/fi/57/575bd269141139e698debdd3a8678998_,152576,393216,644096,1018880,.mp4.csmil/manifest.f4m?hdnea=st=1522880120~exp=1522880420~acl=/z/fi/57/575bd269141139e698debdd3a8678998_*~hmac=a1ab0a0f71e20128b15627b6a1b7e8adeb162d51143e71d54d9fe7c5854bd961&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0
DEBUG: Now trying downloader HDSDump
Output file: c:\Video\Test\Rakastuin mä luuseriin_ S01E04_ Väärä tunne-2017-05-11T01_00.flv
DEBUG: Executing:
DEBUG: php c:\yle-dl-2.31\yledl\AdobeHDS.php --manifest https://areenahdfi-vh.akamaihd.net/z/fi/57/575bd269141139e698debdd3a8678998_,152576,393216,644096,1018880,.mp4.csmil/manifest.f4m?hdnea=st=1522880120~exp=1522880420~acl=/z/fi/57/575bd269141139e698debdd3a8678998_*~hmac=a1ab0a0f71e20128b15627b6a1b7e8adeb162d51143e71d54d9fe7c5854bd961&g=ABCDEFGHIJKL&hdcore=3.8.0&plugin=flowplayer-3.8.0.0 --debug --delete --outfile c:\Video\Test\Rakastuin mä luuseriin_ S01E04_ Väärä tunne-2017-05-11T01_00.flv
Traceback (most recent call last):
  File "c:\tools\python364\Scripts\yle-dl-script.py", line 11, in <module>
    load_entry_point('yle-dl==2.31', 'console_scripts', 'yle-dl')()
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\yledl.py", line 379, in main
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\yledl.py", line 247, in download
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 1008, in download_episodes
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 1055, in process
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 1158, in process_single_episode
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 1001, in download_clip
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 2373, in save_stream
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 2399, in _retry_call
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 2358, in wrapped
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 2125, in save_stream
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 1906, in save_stream
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 1930, in external_downloader
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 1965, in execute
  File "c:\tools\python364\lib\site-packages\yle_dl-2.31-py3.6.egg\yledl\downloaders.py", line 2004, in start_process
  File "c:\tools\python364\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "c:\tools\python364\lib\subprocess.py", line 971, in _execute_child
    args = list2cmdline(args)
  File "c:\tools\python364\lib\subprocess.py", line 461, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: a bytes-like object is required, not 'str'
aajanki commented 6 years ago

This should now be fixed in the master. At least testing on a Windows 10 VM with Python 3.6.5 I'm able to download all three videos.

Note, that you have to enable curl extension on PHP (in case you didn't already do this). Create a file C:\php\php.ini with the following content:

extension_dir=C:\php\ext
extension=php_curl.dll

Before running yle-dl, set the PHPRC environment variable:

PHPRC=C:\php\php.ini
utelle commented 6 years ago

Paljon kiitoksia! Nyt kaikki toimii hienosti!