Hacker News new | ask | show | jobs
by xurukefi 1121 days ago

    $ python yt_fts.py download 'https://www.youtube.com/@ycombinator/videos'
    [...]
      File "/app/yt_fts.py", line 176, in get_channel_id
        channel_id = re.search('channelId":"(.{24})"', html).group(1)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'group'

    $ python yt_fts.py download 'https://www.youtube.com/@ycombinator/videos' --channel-id UCj089h5WsDdh1q8t54K3ZCw
    [...]
      File "/app/yt_fts.py", line 191, in get_channel_name
        data = json.loads(script.string)
                          ^^^^^^^^^^^^^
    AttributeError: 'NoneType' object has no attribute 'string'
works great
3 comments

This tool itself does works great.

This behavior is due to the YouTube cookies consent page.

I opened an issue about this specific issue: https://github.com/NotJoeMartinez/yt-fts/issues/1

Glad if you want to help.

Fixed.
As a workaround you can manually set the channel_name in line 82
Reminds me how much I dislike python error messages, not as much as java but still so much noise to signal by default.