gpodder / gpodder

The gPodder podcast client.

Home Page:http://gpodder.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Download Errors on Youtube videos: HTTP Error 403: Forbidden

Snippet24816 opened this issue · comments

After retrying many times it finally downloads them but I have to re-queue them many many times..
Here's the log:

yt_dlp.utils.DownloadError: ERROR: 
[download] Got error: HTTP Error 403: Forbidden
2023-08-07 22:30:14,012 [youtube-dl] WARNING: JSON subtitles cannot be embedded
2023-08-07 22:51:00,862 [youtube-dl] ERROR: ERROR: 
[download] Got error: HTTP Error 403: Forbidden
2023-08-07 22:51:00,862 [gpodder.download] ERROR: Download failed: ERROR: 
[download] Got error: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "E:****data\lib\python3.10\site-packages\gpodder\download.py", line 910, in run
    headers, real_url = downloader.retrieve_resume(self.tempname, self.status_updated)
  File "E:****data\share\gpodder\extensions\youtube-dl.py", line 116, in retrieve_resume
    res = self._ytdl.fetch_video(info, opts)
  File "E:****data\share\gpodder\extensions\youtube-dl.py", line 356, in fetch_video
    return ydl.process_video_result(info, download=True)
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 2779, in process_video_result
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 3229, in process_info
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 2970, in dl
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/downloader/common.py", line 444, in download
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/downloader/dash.py", line 60, in real_download
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/downloader/fragment.py", line 382, in download_and_append_fragments_multiple
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/downloader/fragment.py", line 521, in download_and_append_fragments
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/downloader/fragment.py", line 466, in download_fragment
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/utils.py", line 6141, in __iter__
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/downloader/fragment.py", line 463, in error_callback
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/downloader/common.py", line 389, in report_retry
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/utils.py", line 6148, in report_retry
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/downloader/common.py", line 392, in <lambda>
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 1015, in report_error
  File "C:/msys64/home/appveyor/_gpodder_build_root/mingw32/lib/python3.10/site-packages/yt_dlp/YoutubeDL.py", line 955, in trouble
yt_dlp.utils.DownloadError: ERROR: 
[download] Got error: HTTP Error 403: Forbidden

HTTP Error 403: Forbidden

This is a common youtube issue when their servers are overloaded. Retrying over and over will likely get you banned, just wait until the next day and the problem will go away.

Alright glad I asked thank you so much ;-)

Maybe take a VPN and switch locations when it happens :-)

Yeah thats seem to be a definitive solution.. I hope because it is still returning the error

Question I noticed gPodder is downloading at 10MB/s even though I have it limited to 500Kb, could this be causing the 403 error?

I assume you have the limit rate to checkbox checked. The rate limit is "per" download, do you have 20 concurrent downloads, or a single download at 10MB/s?

I use 6 concurrent downloads with a limit of 4MB/s each, but I mostly use the built-in youtube support, so each video downloads at ~50kB/s, 300kB/s total bandwidth with 6 active downloads. And I see 403 errors several times a week. When I get any kind of error, I re-download with yt-dlp, and it usually always works.

Google throttled everyone to 50kB/s and using yt-dlp to exceed that limit amounts to abuse. Opening multiple connections to a server is also abuse, especially a lot of them (concurrent downloads). It is possble a high number of consistent 403 errors could be triggered by abusive behavior from the client. However, blocking based on total bandwidth or concurrent connections would disrupt the normal viewing for users who share an IP address with others (cell phones, schools, ...).

I assume you have the limit rate to checkbox checked.

Yes

Google throttled everyone to 50kB/s and using yt-dlp to exceed that limit amounts to abuse.

Thank you wasn't aware of that

In the past I had 6, but I tried too setting only one download at a time, and it still downloads at 10mb/s which is weird (or at least thats what appears in the top window/ and in the progress tab. Will set nevertheless the limit to 50Kb.
Update: after setting 50kb it says it downloads at 216kb at times so I'm confused there..

Is this with short or long videos?

Gpodder limits the rate by grabbing a chunk and then sleeping. If it takes 1 second to download a chunk, and your bandwidth is 4x the limit, then gpodder will sleep for 3 seconds between chunks. A 10MB video might fully download in the first chunk with 10MB/s of bandwidth, and gpodder will show 10MB/s before it sleeps for a bit, then finish downloading the video in the second chunk. On a longer video, it will start out high and slowly average down to the rate limit. So the rate limit really only works on longer content.

They are usually 70 MB on average and lowest are above 10mb. Thing is I'm still getting the forbidden error.. So a VPN may be the only solution I guess.. :/ Question what about setting a global hard limit limit or is it too complicated? or a limitation from yd-dlp?

Have you tried downloading at different times of day?

what about setting a global hard limit limit or is it too complicated?

It wouldn't be impossible to implement, but it also isn't a trivial task. Simplest approach would be to divide the total limit by number of active downloads, and limit each download using that value. But then you could have a bunch of really slow downloads and are now limiting the one fast download, using only a fraction of your total limit. So it would need to calculate what percentage of the total bandwidth each download is using, and then enforce per-download limits that add up to the total limit. That would require safely sharing data across threads, and adjusting the per-download limits in realtime as rates change.

I was reading and found that the solution to this error is to update yt-dlp to latest version:
yt-dlp/yt-dlp#7892

Have you tried downloading at different times of day?

Yes

It wouldn't be impossible to implement, but it also isn't a trivial task.

I see

The solution isn't to update to a newer version, at least until they fix yt-dlp/yt-dlp#7860 and make a release. The last release is 2023.07.06, which would be in all gpodder builds since that day. And you have that version if you are running from git or using the last working build for Windows 7 https://ci.appveyor.com/project/elelay/gpodder/builds/47665131/artifacts.

And you have that version if you are running from git or using the last working build for Windows 7 https://ci.appveyor.com/project/elelay/gpodder/builds/47665131/artifacts.

Indeed I stand corrected, thank you much working fine :-)

Did you have an older build of gpodder with an older yt-dlp?

Yes, but because I thought I had the last w7 version if I recap correctly..