aajanki / yle-dl

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

yle-dl 20211213: Crash when trying to download a collection of short films #293

Closed deriv closed 2 years ago

deriv commented 2 years ago

yle-dl 20211213 pip 20.3.4 from /usr/lib/python3.10/site-packages/pip (python 3.10) Python 3.10.1 ffmpeg version n4.4.1

This crash seems to occur with at least with one collection of short films:

`$ yle-dl https://areena.yle.fi/tv/ohjelmat/30-1774 yle-dl 20211213: Download media files from Yle Areena and Elävä Arkisto Copyright (C) 2009-2021 Antti Ajanki antti.ajanki@iki.fi, license: GPLv3

Traceback (most recent call last): File "/home/kayttaja/.local/bin/yle-dl", line 8, in sys.exit(main()) File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/yledl.py", line 471, in main res = execute_action(url, action, io, httpclient, title_formatter, File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/yledl.py", line 289, in execute_action return download_clips(clips(), dl, io, title_formatter, stream_filters) File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/yledl.py", line 296, in download_clips clips = list(clips) File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/extractors.py", line 210, in return (self.extract_clip(clipurl, title_formatter, ffprobe) File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/extractors.py", line 437, in extract_clip program_info = self.program_info_for_pid( File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/extractors.py", line 623, in program_info_for_pid preview = self.preview_parser(pid, pageurl) File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/extractors.py", line 696, in preview_parser preview_json = jsonhelpers.load_json(self.preview_url(pid), File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/jsonhelpers.py", line 5, in load_json json_string = httpclient.download_page(url, headers) File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/http.py", line 45, in download_page response = self.get(url, extra_headers) File "/home/kayttaja/.local/lib/python3.10/site-packages/yledl/http.py", line 92, in get r.raise_for_status() File "/usr/lib/python3.10/site-packages/requests/models.py", line 953, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://player.api.yle.fi/v1/preview/30-1774.json?language=fin&ssl=true&countryCode=FI&host=areenaylefi&app_id=player_static_prod&app_key=8930d72170e48303cf5f3867780d549b`

aajanki commented 2 years ago

Thanks for the report! Collection pages like that are indeed not yet supported. I'll see what I can do about it. For the moment, a workaround is to download each episode separately.

ExTechOp commented 2 years ago

It seems YLE is getting more into this kind of collection pages, I ran into the identical issue when trying to do: yle-dl --output-template '${series}-${episode}-${title}.mp4' https://areena.yle.fi/tv/ohjelmat/30-3386

ExTechOp commented 2 years ago

The same issue persists with: yle-dl --output-template '${series}-${episode}-${title}.mp4' https://areena.yle.fi/tv/ohjelmat/30-1536