ihabunek / twitch-dl

CLI tool for downloading videos from Twitch.
GNU General Public License v3.0
652 stars 83 forks source link

403 Forbidden #147

Closed toddfoster closed 8 months ago

toddfoster commented 8 months ago

Last week (and for the last year or two) I have used twitch-dl once or twice a week without issue. Thank you!

This week it quit.

I'm downloading a publicly available VOD in an account I control (i.e., I didn't change the privacy settings). There's no reason I know of why anything should have changed. I hope Twitch isn't changing the API to exclude twitch-dl!

todd@bartleby:~/Videos$ twitch-dl --version
twitch-dl v2.1.3
todd@bartleby:~/Videos$ twitch-dl download 2024888632 --overwrite --quality source --output  "{channel_login}_{datetime}.{format}"
Looking up video...
Found: St. Thomas' at Prayer by StThomasGlassboro
Output: stthomasglassboro_2024-01-06T22:18:29Z.mkv
Fetching access token...
Fetching playlists...
Traceback (most recent call last):
  File "/home/todd/.local/bin/twitch-dl", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/todd/.local/pipx/venvs/twitch-dl/lib/python3.11/site-packages/twitchdl/console.py", line 321, in main
    args.func(args)
  File "/home/todd/.local/pipx/venvs/twitch-dl/lib/python3.11/site-packages/twitchdl/commands/download.py", line 170, in download
    download_one(video_id, args)
  File "/home/todd/.local/pipx/venvs/twitch-dl/lib/python3.11/site-packages/twitchdl/commands/download.py", line 176, in download_one
    return _download_video(video_id, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/todd/.local/pipx/venvs/twitch-dl/lib/python3.11/site-packages/twitchdl/commands/download.py", line 292, in _download_video
    playlists_m3u8 = twitch.get_playlists(video_id, access_token)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/todd/.local/pipx/venvs/twitch-dl/lib/python3.11/site-packages/twitchdl/twitch.py", line 347, in get_playlists
    response.raise_for_status()
  File "/home/todd/.local/pipx/venvs/twitch-dl/lib/python3.11/site-packages/httpx/_models.py", line 758, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '403 Forbidden' for url 'http://usher.ttvnw.net/vod/2024888632?nauth=%7B%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22device_id%22%3Anull%2C%22expires%22%3A1704720123%2C%22https_required%22%3Atrue%2C%22privileged%22%3Afalse%2C%22user_id%22%3Anull%2C%22version%22%3A2%2C%22vod_id%22%3A2024888632%7D&nauthsig=57eb22d78e9931db5cfdf26be56bf6f3b9e1c6a5&allow_audio_only=true&allow_source=true&player=twitchweb'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
todd@bartleby:~/Videos$ 
toddfoster commented 8 months ago

Never mind. Updated twitch-dl and all is good. Sorry for the false alarm!