mfherbst / down-frab-videos

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

pycountry bug in recent version #14

Closed joker234 closed 5 years ago

joker234 commented 5 years ago

@pseyfert and I detected a bug regarding the recent pycountry in version 18.12.8. If I install an older version, using pip3 install "pycountry==18.5.26" everything works fine.

With 18.12.8:

$ down-frab-videos 9744                                         
#######################################
#-- Gathering lecture data for 35c3 --#
#######################################
 - Media file information from "cdn.media.ccc.de" for the formats:
    - webm-hd
Traceback (most recent call last):
  File "/home/user/.local/bin/down-frab-videos", line 4, in <module>
    main()
  File "/home/user/.local/lib/python3.7/site-packages/down_frab_videos/__init__.py", line 1055, in main
    raise_on_error=args.strict))
  File "/home/user/.local/lib/python3.7/site-packages/down_frab_videos/__init__.py", line 195, in __init__
    self.__parse_link(hreftext, self.cached)
  File "/home/user/.local/lib/python3.7/site-packages/down_frab_videos/__init__.py", line 346, in __parse_link
    languages = media_url_builder.__parse_languages(link, splitted)
  File "/home/user/.local/lib/python3.7/site-packages/down_frab_videos/__init__.py", line 297, in __parse_languages
    languages.add(getattr(langobject, lang_outkey))
AttributeError: 'NoneType' object has no attribute 'alpha_3'

With 18.5.26:

$ down-frab-videos 9744 
#######################################
#-- Gathering lecture data for 35c3 --#
#######################################
 - Media file information from "cdn.media.ccc.de" for the formats:
    - webm-hd
      ... skipping "35c3-9904-eng-deu-chi-The_Social_Credit_System_webm-hd.webm" (invalid language code)

      Note: The skipped files could not be parsed and will not be available
            for download. Either patch this script or download them manually.

 - Fahrplan from "fahrplan.events.ccc.de".
 - Finished: Got "35th Chaos Communication Congress", version "Love Boat"

Saving an error log to the file "errors".

############
#-- 9744 --#
############
[…]
mfherbst commented 5 years ago

Thanks for the report. I'll take a look into it.

mfherbst commented 5 years ago

Fixed by 4bee4c5ad4e8ea4f9f3a0ed1333bbc54ced28317 on my machine. Could you please verify current master works for you as well?

pseyfert commented 5 years ago

the fix works for me

pseyfert commented 5 years ago

FYI we got a pointer to this concerning the language codes.

mfherbst commented 5 years ago

Great. Thanks ... that's a bit yikes. I thought the would adhere to some kind of standard. Turns out it's their own ;). But if one uses the table you reference it will allow to make down-frab-videos more reliable and remove a lot of hackery.

mfherbst commented 5 years ago

Closing this for now.

joker234 commented 5 years ago

FYI we got a pointer to this concerning the language codes.

FYI: I got in touch with voc and want to figure out if they will use one standard instead of multiple one or their own.

mfherbst commented 5 years ago

Cool. Thanks.

mfherbst commented 5 years ago

Related to #16