mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-16 22:37:35 +00:00
[hls downloader] Sleep 10 seconds after getting a 429 Too Many Requests
Otherwise the next retry will happen immediately, most likely also getting a 429.
This commit is contained in:
parent
e6a836d54c
commit
890f5a41b9
@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import binascii
|
import binascii
|
||||||
|
import time
|
||||||
try:
|
try:
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
can_decrypt_frag = True
|
can_decrypt_frag = True
|
||||||
@ -159,6 +160,8 @@ class HlsFD(FragmentFD):
|
|||||||
count += 1
|
count += 1
|
||||||
if count <= fragment_retries:
|
if count <= fragment_retries:
|
||||||
self.report_retry_fragment(err, frag_index, count, fragment_retries)
|
self.report_retry_fragment(err, frag_index, count, fragment_retries)
|
||||||
|
if err.code == 429:
|
||||||
|
time.sleep(10.0)
|
||||||
if count > fragment_retries:
|
if count > fragment_retries:
|
||||||
if skip_unavailable_fragments:
|
if skip_unavailable_fragments:
|
||||||
i += 1
|
i += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user