mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 22:34:01 -07:00
Made my changes compliant to conventions
I used flake8 to make my code compliant to conventions used in the project, and the community.
This commit is contained in:
parent
6d447d14c7
commit
a394706c83
4 changed files with 6 additions and 4 deletions
|
@ -113,6 +113,7 @@ from .version import __version__
|
|||
if compat_os_name == 'nt':
|
||||
import ctypes
|
||||
|
||||
|
||||
class YoutubeDL(object):
|
||||
"""YoutubeDL class.
|
||||
|
||||
|
@ -824,7 +825,7 @@ class YoutubeDL(object):
|
|||
self.report_error(compat_str(e), e.format_traceback())
|
||||
except MaxDownloadsReached:
|
||||
raise
|
||||
except Forbidden403 as err:
|
||||
except Forbidden403:
|
||||
# Lets not abuse of this 😜 we don't want to get brutal on the server
|
||||
time.sleep(random.randint(3, 13))
|
||||
wrapper(self, *args, **kwargs)
|
||||
|
|
|
@ -481,5 +481,4 @@ def main(argv=None):
|
|||
sys.exit('\nERROR: Interrupted by user')
|
||||
|
||||
|
||||
|
||||
__all__ = ['main', 'YoutubeDL', 'gen_extractors', 'list_extractors']
|
||||
|
|
|
@ -2997,9 +2997,11 @@ else:
|
|||
def compat_ctypes_WINFUNCTYPE(*args, **kwargs):
|
||||
return ctypes.WINFUNCTYPE(*args, **kwargs)
|
||||
|
||||
|
||||
# Implement an error for which it is raise when error code 403 HTTPError
|
||||
class Forbidden403(Exception):
|
||||
pass
|
||||
pass
|
||||
|
||||
|
||||
__all__ = [
|
||||
'compat_HTMLParseError',
|
||||
|
|
|
@ -187,7 +187,7 @@ class HttpFD(FileDownloader):
|
|||
elif err.code != 403 and (err.code < 500 or err.code >= 600):
|
||||
# Unexpected HTTP error
|
||||
raise
|
||||
elif err.code == 403: # The famous 403 Forbidden error
|
||||
elif err.code == 403: # The famous 403 Forbidden error
|
||||
raise Forbidden403
|
||||
raise RetryDownload(err)
|
||||
except socket.error as err:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue