-
-
Notifications
You must be signed in to change notification settings - Fork 183
Description
SABR Maximum reload attempts reached. (Error Message)
๐ Bug Description
Iโm facing a problem when I run the code and start downloading. I get the message:
SABR YouTube is forcing ads, wait 4.0 seconds to skip
It repeats several times, and then I get this error:
SABR YouTube is forcing ads, wait 4.0 seconds to skip
SABR YouTube is forcing ads, wait 4.0 seconds to skip
An error occurred: SABR Maximum reload attempts reached. Stream protection status: PoToken PENDING
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\LastestBots\Runable\Player - T3arof\TCP_DOWNLOADER.py", line 79, in YT_Download2
await download_youtube_audio2(video_link, output_filename)
File "C:\Users\Administrator\Desktop\LastestBots\Runable\Player - T3arof\TCP_DOWNLOADER.py", line 46, in download_youtube_audio2
audio_stream.download(filename=output_filename+'.mp4',output_path=f"C:/Users\Administrator\Desktop\HALLO\")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\streams.py", line 411, in download
ServerAbrStream(stream=self, write_chunk=write_chunk, monostate=self._monostate).start()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytubefix\sabr\core\server_abr_stream.py", line 178, in start
raise SABRError(
pytubefix.exceptions.SABRError: SABR Maximum reload attempts reached. Stream protection status: PoToken PENDING
I renewed both the PoToken and VisitorData around ten minutes before the error occurred. The downloads were working fine for about three songs before this error appeared (as shown in the output).
Whatโs the solution to this issue?
Iโm using pytubefix 10 and Python 3.11.9.
๐ข Code Snippet
Include the minimal code snippet that reproduces the issue.
async def download_youtube_audio2(url, output_filename):
output_video_path = f"C:/Users\\Administrator\\Desktop\\HALLO\\"+output_filename+'.mp4'
try:
yt = YouTube(url,"WEB", on_progress_callback=on_progress, use_po_token=True)
audio_stream = yt.streams.filter(only_audio=True).first()
except:
results = Search(output_filename)
print("11 - For Debugging")
url = results.videos[1].watch_url
yt = YouTube(url,"WEB", on_progress_callback=on_progress, use_po_token=True)
audio_stream = yt.streams.filter(only_audio=True).first()
audio_stream.download(filename=output_filename+'.mp4',output_path=f"C:/Users\\Administrator\\Desktop\\HALLO\\")
return output_video_path๐ฏ Expected Behavior
I thought that updating the PoToken and VisitorData would fix the issue, as it usually did before when I manually refreshed them from the browser.
However, now it only works for a very short time โ around five minutes or so โ and then stops working again.
If I pause the downloads for a while and come back, I find that the tokens are no longer valid or effective.
At first, I suspected that my IP address might be blocked by YouTube, but when I open YouTube in my browser, everything works normally without any restrictions.
๐ธ Screenshots or Logs
๐ฅ๏ธ Environment Details
Fill in the details below about your setup:
- Operating System: Windows11
- Python Version: Python 3.11.9
- Pytubefix Version: 10.0.0
๐ Additional Notes
- I tried to generate a PoToken & VisitorData using another IP addresses, but same problem.
- I tried to change from "WEB" to "IOS" & "ANDROID" but the same problem also.
๐ Next Steps
..
Metadata
Metadata
Assignees
Labels
Projects
Status