mfherbst / down-frab-videos

Download videos and lecture attachments from CCC events
GNU General Public License v3.0
11 stars 3 forks source link

Stack trace when downloading subtitles #5

Closed JanX2 closed 7 years ago

JanX2 commented 7 years ago
#######################################
#-- Gathering lecture data for 33c3 --#
#######################################
   - Info about video files from "cdn.media.ccc.de"
Traceback (most recent call last):
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 1016, in <module>
    builders = [ media_url_builder(selected_event["media_prefix"], format) for format in selected_formats ]
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 1016, in <listcomp>
    builders = [ media_url_builder(selected_event["media_prefix"], format) for format in selected_formats ]
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 293, in __init__
    self.__parse_link(hreftext,self.cached)
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 421, in __parse_link
    languages = media_url_builder.__parse_languages(link,splitted)
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 376, in __parse_languages
    langobject = pycountry.languages.get(**{lang_inkey: part})
TypeError: load_if_needed() keywords must be strings

This is with Python 3.6.0. Finally upgraded. ;)

Happened with 2.7 as well (before upgrading).

Both times a pip install pycountry was necessary, of course.

mfherbst commented 7 years ago

The issue here is that unfortunately every version of pycountry uses different keys for the lookup (The joys of duck typing ...). I now added some more educated guesses and a more helpful error message. Try again commit ce76375 and let me know what it says in case it still fails.

JanX2 commented 7 years ago
#######################################
#-- Gathering lecture data for 33c3 --#
#######################################
   - Info about video files from "cdn.media.ccc.de"
Traceback (most recent call last):
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 1016, in <module>
    builders = [ media_url_builder(selected_event["media_prefix"], format) for format in selected_formats ]
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 1016, in <listcomp>
    builders = [ media_url_builder(selected_event["media_prefix"], format) for format in selected_formats ]
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 293, in __init__
    self.__parse_link(hreftext,self.cached)
  File "/Users/jan/Development/Projects/down-frab-videos/down_frab_videos.py", line 432, in __parse_link
    + langmap[key]["url"] + "\".")
__main__.InvalidMediaPageError: Found the language key "deu-eng-fra" twice in the language map. It was generated from both the links "33c3-8429-eng-deu-fra-33C3_Opening_Ceremony.en.srt" as well as "https://cdn.media.ccc.de/congress/2016/subtitles/33c3-8429-eng-deu-fra-33C3_Opening_Ceremony.de.srt".
mfherbst commented 7 years ago

Ok at least now we have a different issue ... apparently downloading subtitles does not work yet.

I'll quickly code a version of the script where such invalid media page entries don't yield to an abortion of the script. I hope you did not care about the opening ceremony which caused this stacktrace ;)

mfherbst commented 7 years ago

Quick fix pushed as d41f920.

JanX2 commented 7 years ago

Finishes launching and started processing again with the fix. Let’s see how long it will survive. :D

JanX2 commented 7 years ago

BTW: This is the first time the script ran through all the way for me. :)