Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pluralsight] improve preventing error 429 #28712

Merged
merged 1 commit into from
Apr 16, 2021
Merged

Conversation

quyleanh
Copy link

@quyleanh quyleanh commented Apr 9, 2021

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Improve preventing error 429 by increasing sleep timeout.
The current random function can be detect if its value is 2 second.

Improve preventing error 429 by increasing sleep timeout.
The current random function can be detect if its value is 2 second.
@dstftw
Copy link
Collaborator

dstftw commented Apr 9, 2021

  1. It's not 2 seconds.
  2. You must provide clear evidence this has any effect at all.

@quyleanh
Copy link
Author

quyleanh commented Apr 9, 2021

The value is randomly chosen from 2 to 5 second. I have notice that if the waiting timeout is 2 second. There is error 429. After changing I have no problem.

Here is the log. Maybe I mistake about it.

[download] Downloading video 12 of 42
[pluralsight] 97fe200e-dd3d-449a-bc20-ec78d6775c17-2: Downloading JSON metadata
[pluralsight] 97fe200e-dd3d-449a-bc20-ec78d6775c17-2: Downloading mp4-high-widescreen viewclip graphql
[pluralsight] 97fe200e-dd3d-449a-bc20-ec78d6775c17-2: Downloading mp4-high-widescreen viewclip JSON
[pluralsight] 97fe200e-dd3d-449a-bc20-ec78d6775c17-2: Waiting for 3 seconds to avoid throttling
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://vid30.pluralsight.com/clips/resolution/b5645322-c427-4039-8a25-f0a4629fac0c/current/mp4/1280x720.mp4?verify=1617950195-1zKiAdZAkJ%2BN6YuM9566eZymS6oila5XUGhhw5bCIMA%3D'
[download] 12-3-Demo - Understanding the Bootstrap Grid System-1280x720.mp4 has already been downloaded
^M[download] 100% of 23.78MiB
[download] Downloading video 13 of 42
[pluralsight] 97fe200e-dd3d-449a-bc20-ec78d6775c17-3: Downloading JSON metadata
[pluralsight] 97fe200e-dd3d-449a-bc20-ec78d6775c17-3: Downloading mp4-high-widescreen viewclip graphql
[pluralsight] 97fe200e-dd3d-449a-bc20-ec78d6775c17-3: Downloading mp4-high-widescreen viewclip JSON
WARNING: Unable to download JSON metadata: HTTP Error 429: Too Many Requests
[pluralsight] 97fe200e-dd3d-449a-bc20-ec78d6775c17-3: Waiting for 2 seconds to avoid throttling
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with  the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/home/quyleanh/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "/home/quyleanh/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 827, in __extract_info
    ie_result = ie.extract(url)
  File "/home/quyleanh/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "/home/quyleanh/.local/lib/python3.8/site-packages/youtube_dl/extractor/pluralsight.py", line 421, in _real_extract
    self._sort_formats(formats)
  File "/home/quyleanh/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 1374, in _sort_formats
    raise ExtractorError('No video formats found')
youtube_dl.utils.ExtractorError: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be     sure to call youtube-dl with the --verbose flag and include its complete output.

@quyleanh
Copy link
Author

quyleanh commented Apr 9, 2021

I also add --sleep-interval with value 150 and --max-sleep-interval with value 200 with --limit-rate

@SSoft7
Copy link

SSoft7 commented Apr 12, 2021

  1. It's not 2 seconds.
  2. You must provide clear evidence this has any effect at all.

I was about to make a pull request as well. He is right, 2-5 seconds of sleep is not enough, and the --sleep-interval won't work. This may not be the latest code, but JDownloader currently has 60seconds-2minutes minimum delay before each request.
If you just use the --all-subs --skip-download --min-sleep-interval 120 --max-sleep-interval 240 to download all the subs of a course the 2nd one will fail.

In my opinion, a larger delay like 60 seconds should be enough for now.

@dstftw dstftw merged commit 79e4ccf into ytdl-org:master Apr 16, 2021
github-actions bot added a commit to hellopony/youtube-dl that referenced this pull request Apr 16, 2021
* https://github.com/ytdl-org/youtube-dl:
  [youtube] Improve stretch extraction and fix stretched ratio calculation (closes ytdl-org#28769)
  [youtube:tab] Improve grid extraction (closes ytdl-org#28725)
  [youtube:tab] Detect series playlist on playlists page (closes ytdl-org#28723)
  [youtube] Add more invidious instances (ytdl-org#28706)
  [pluralsight] Extend anti-throttling timeout (ytdl-org#28712)
  [youtube] Improve URL to extractor routing (closes ytdl-org#27572, closes ytdl-org#28335, closes ytdl-org#28742)
@SSoft7
Copy link

SSoft7 commented Apr 25, 2021

@dstftw Unfortunately, This is still failing. I have tried increasing random wait time to random.randint(300, 600) in my dev environment, but that is failing as well.
I think this plugin needs further modification for proper work. I am attaching log and the latest java plugin from jdownloader for reference. This is working perfectly in jdownloader.
PluralsightCom.zip

pluralsight:course] playlist Deep Dive into Go Packages: Collected 32 video ids (downloading 32 of them)
[download] Downloading video 1 of 32
[pluralsight] 9540ccbe-6ecf-4cee-a420-585d345d36e0-0: Downloading JSON metadata
[pluralsight] 9540ccbe-6ecf-4cee-a420-585d345d36e0-0: Downloading mp4-high-widescreen viewclip graphql
[pluralsight] 9540ccbe-6ecf-4cee-a420-585d345d36e0-0: Downloading mp4-high-widescreen viewclip JSON
[pluralsight] 9540ccbe-6ecf-4cee-a420-585d345d36e0-0: Waiting for 554 seconds to avoid throttling
[pluralsight] 9540ccbe-6ecf-4cee-a420-585d345d36e0-0: Downloading captions JSON
[info] Writing video subtitles to: Deep Dive into Go Packages\1 - Course Overview\1-Course Overview.en.srt
[download] Downloading video 2 of 32
[pluralsight] b5e3dad8-f152-4ce6-9a22-1ca08df96726-0: Downloading JSON metadata
[pluralsight] b5e3dad8-f152-4ce6-9a22-1ca08df96726-0: Downloading mp4-high-widescreen viewclip graphql
[pluralsight] b5e3dad8-f152-4ce6-9a22-1ca08df96726-0: Downloading mp4-high-widescreen viewclip JSON
[pluralsight] b5e3dad8-f152-4ce6-9a22-1ca08df96726-0: Waiting for 599 seconds to avoid throttling
ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants