Leetcore / audiothek-downloader

Download stuff from ARD audiothek.
Mozilla Public License 2.0
22 stars 1 forks source link

AttributeError: 'NoneType' object has no attribute 'get' #2

Closed bekopharm closed 1 year ago

bekopharm commented 1 year ago

rev: be4ade0d4c821f4b2cbad8ec72f7684799d3dc44

cmd: python3 audiothek.py --url 'https://www.ardaudiothek.de/sammlung/zeit-zum-hoeren-geschichten-in-xxl/12456677/'

Traceback (most recent call last):
  File "audiothek-downloader/audiothek.py", line 68, in <module>
    main(url, folder)
  File "audiothek-downloader/audiothek.py", line 11, in main
    nodes = response_json.get("data").get("result").get("items").get("nodes")
AttributeError: 'NoneType' object has no attribute 'get'
Leetcore commented 1 year ago

We have no GraphQL request for type "sammlung" yet. I'm working on it.

bekopharm commented 1 year ago

I see. Downloading from e.g. https://www.ardaudiothek.de/sendung/wdr-5-kinderhoerspiel/36244846/ worked just fine 👍

So many stories for our TonUINO|s :100:

Leetcore commented 1 year ago

I have fixed the error and the script can download a "sammlung" now. But you will only get the first episode of the collection. The parent of an episode is a broadcast but they might be only structured with "1 of 3" in the title. So its not possible right now to fully download a "sammlung". I tried to download also the parent broadcast but that is A LOT because it would download everything not the selected titles from "sammlung".

I will try to match "sammlung" also by title in the future. :)

wieland-s commented 5 months ago

Rev: b357f987185004b355de890f1d0cf0f09a275fee / master

Having the same error:

python audiothek.py --url 'https://www.ardaudiothek.de/sendung/cixin-liu-trisolaris-trilogie-sci-fi-hoerspiel-serie-wdr/13220399/'
Traceback (most recent call last):
  File "/Users/WS/Documents/tools/audiothek-downloader/audiothek.py", line 105, in <module>
    main(url, folder)
  File "/Users/WS/Documents/tools/audiothek-downloader/audiothek.py", line 12, in main
    downloadEpisodes(id, folder)
  File "/Users/WS/Documents/tools/audiothek-downloader/audiothek.py", line 51, in downloadEpisodes
    image_url = node.get("image").get("url")
                ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

But the example here from @bekopharm

I see. Downloading from e.g. https://www.ardaudiothek.de/sendung/wdr-5-kinderhoerspiel/36244846/ worked just fine 👍

does also throw the error:

python3 audiothek.py --url "https://www.ardaudiothek.de/sendung/wdr-5-kinderhoerspiel/36244846/"
Traceback (most recent call last):
  File "/Users/WS/Documents/tools/audiothek-downloader/audiothek.py", line 105, in <module>
    main(url, folder)
  File "/Users/WS/Documents/tools/audiothek-downloader/audiothek.py", line 12, in main
    downloadEpisodes(id, folder)
  File "/Users/WS/Documents/tools/audiothek-downloader/audiothek.py", line 51, in downloadEpisodes
    image_url = node.get("image").get("url")
                ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Am I using something fundamentally wrong? Or has something changed in the data structure?

Leetcore commented 5 months ago

DownloadURL was missing in this case but i added a workaround for this. Please update to the newest version.

wieland-s commented 5 months ago

DownloadURL was missing in this case but i added a workaround for this. Please update to the newest version.

Works now. Thanks!