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

[core] Rework HTTP networking #2861

Closed
wants to merge 394 commits into from
Closed
Show file tree
Hide file tree
Changes from 150 commits
Commits
Show all changes
394 commits
Select commit Hold shift + click to select a range
09fe38c
Break apart prepare_request a bit and add can_handle func
coletdjnz Aug 30, 2022
c956303
Allow file:// URLs to be enabled
coletdjnz Aug 30, 2022
4b95ba1
remove unnecessary check in the case no response is returned
coletdjnz Aug 30, 2022
7c4e8f6
[urllib] Do not try decode Brotli-encoded responses if Brotli is not …
coletdjnz Sep 1, 2022
7150f97
Remove redundant Youtubedl-no-compression header
coletdjnz Sep 5, 2022
e39937f
Add `Accept-Encoding: identity` header if it isn't already added
coletdjnz Sep 5, 2022
b4bb99b
remove redundant error handling
coletdjnz Sep 5, 2022
08e6b92
--enable-file-protocol --> --enable-file-urls
coletdjnz Sep 5, 2022
ee0d4ca
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Sep 5, 2022
1ec4e39
Fix test file urls on windows
coletdjnz Sep 5, 2022
7e82f38
linter
coletdjnz Sep 5, 2022
f2501de
cleanup
coletdjnz Sep 5, 2022
fc4d0d7
move RequestDirector to `__init__.py`
coletdjnz Sep 7, 2022
b17943b
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Oct 26, 2022
df68761
Add is_path_like back
coletdjnz Oct 26, 2022
5ce6a30
Move cookie handler to after youtubedl handler
coletdjnz Oct 26, 2022
6ed3319
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Nov 7, 2022
8c333fc
cleanup after merge
coletdjnz Nov 7, 2022
b1b6aa3
Use 3.10 ciphers for all python versions; add --cipher-list option
coletdjnz Nov 7, 2022
5e6ab66
Merge ssl context creation functions
coletdjnz Nov 7, 2022
fefcf4a
Enable PHA for client certs
coletdjnz Nov 7, 2022
126e5b9
fixup docstring
coletdjnz Nov 8, 2022
ef955d1
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Nov 9, 2022
eba82a6
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Nov 10, 2022
2361e43
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Nov 10, 2022
c3e0d17
linter
coletdjnz Nov 13, 2022
a766712
fix legacy server connect ssl error message
coletdjnz Nov 13, 2022
66ecc4d
create compat utils
coletdjnz Nov 13, 2022
9a69fd6
fixup
coletdjnz Nov 13, 2022
336662d
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Nov 13, 2022
9a67933
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Nov 29, 2022
b15b29f
cleanup after merge
coletdjnz Nov 29, 2022
7432ae5
fix std_headers import
coletdjnz Nov 29, 2022
4ef02c6
Does this fix unclose SSLSocket warning?
coletdjnz Nov 29, 2022
8ded967
move test_extract_basic_auth to test_networking_utils.py
coletdjnz Nov 29, 2022
e78f9cf
show error type name for unexpected errors
coletdjnz Nov 29, 2022
b40a41d
Add support for preferred handlers + minor cleanup
coletdjnz Nov 30, 2022
d68ba27
Add test for non-existent handler
coletdjnz Nov 30, 2022
6ead834
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Nov 30, 2022
3f111bd
fix base handler priority
coletdjnz Nov 30, 2022
4f7a573
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Jan 2, 2023
a89139b
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Mar 3, 2023
56df2dd
cleanup after merge
coletdjnz Mar 3, 2023
0a6ea37
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Mar 4, 2023
fd815b1
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Apr 20, 2023
8e21496
rename to help merge
coletdjnz Jun 4, 2023
b32bd5c
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Jun 4, 2023
d555c3a
cleanup after merge
coletdjnz Jun 4, 2023
3e1c833
remove allow_redirects
coletdjnz Jun 4, 2023
072679b
Remove preferred_handlers
coletdjnz Jun 4, 2023
d001eac
Remove --cipher-list
coletdjnz Jun 4, 2023
ce63877
compat utils
coletdjnz Jun 4, 2023
13fd598
flake8
coletdjnz Jun 4, 2023
4a0ae80
Move Request to separate file
coletdjnz Jun 4, 2023
04690e3
Move Response to separate file
coletdjnz Jun 4, 2023
b7a862f
move compat request type conversion to YoutubeDL.urlopen
coletdjnz Jun 4, 2023
ee75ea6
Move ssl context creation to util function
coletdjnz Jun 4, 2023
693e929
rename urllib handlers
coletdjnz Jun 4, 2023
1408e38
Move file:// scheme check to base RequestHandler
coletdjnz Jun 4, 2023
1914669
PreparedRequest draft implementation
coletdjnz Jun 4, 2023
2ed205a
improvements
coletdjnz Jun 9, 2023
39daff2
prepared request do not depend on ydl
coletdjnz Jun 9, 2023
ed6ff18
InstanceRepository draft
coletdjnz Jun 10, 2023
a2305a5
As a mixin
coletdjnz Jun 10, 2023
31e6ba5
Disconnect RequestDirector from ydl
coletdjnz Jun 10, 2023
f8203fd
Add back add_header
coletdjnz Jun 10, 2023
c821777
cookiejar per request :sunglasses:
coletdjnz Jun 10, 2023
0ff78df
Remmove get_redirect_url in response
coletdjnz Jun 10, 2023
6a63666
misc cleanup
coletdjnz Jun 10, 2023
54e1103
change handler calling logic
coletdjnz Jun 11, 2023
47fc524
make validate method public
coletdjnz Jun 11, 2023
c9f5d65
prepare should be called in ydl, not director
coletdjnz Jun 11, 2023
5b1a333
another idea
coletdjnz Jun 11, 2023
9f9f837
improvements
coletdjnz Jun 12, 2023
f6fe625
don't have extensions param in user facing request
coletdjnz Jun 12, 2023
76d47f8
reorganise file
coletdjnz Jun 12, 2023
6801b17
Just use a normal Request and clean it in ytdl
coletdjnz Jun 13, 2023
f1aef3d
Remove dependency on ydl for RequestHandler
coletdjnz Jun 14, 2023
ee109c3
bugs
coletdjnz Jun 14, 2023
8595820
fix typing
coletdjnz Jun 14, 2023
4d94009
improve request director error messages
coletdjnz Jun 15, 2023
24fd3c6
more improvements to exception handling and typing
coletdjnz Jun 15, 2023
1d11070
cleanup Response
coletdjnz Jun 15, 2023
8d9bcec
Cleanup Request
coletdjnz Jun 15, 2023
7eb397e
legacy module improvements
coletdjnz Jun 15, 2023
b0fde92
Fix http downloader
coletdjnz Jun 15, 2023
78f4b76
Update yt_dlp/extractor/panopto.py
coletdjnz Jun 15, 2023
0a0b5fa
Update yt_dlp/networking/_urllib.py
coletdjnz Jun 15, 2023
7d9f13c
initial request handler pytest tests
coletdjnz Jun 16, 2023
350d144
Merge remote-tracking branch 'origin/network-overhaul' into network-o…
coletdjnz Jun 16, 2023
b86ad61
Fix fixture
coletdjnz Jun 17, 2023
b4c078e
fix up existing tests
coletdjnz Jun 18, 2023
13962ef
Add headers, timeout and source_address tests
coletdjnz Jun 18, 2023
e11f8cb
make test timeout shorter
coletdjnz Jun 18, 2023
9eb1c04
Validation tests
coletdjnz Jun 19, 2023
155db32
remove base request handler
coletdjnz Jun 19, 2023
dea90af
Add Youtubedl.urlopen tests
coletdjnz Jun 21, 2023
fd5c48f
make RequestHandler fields public
coletdjnz Jun 21, 2023
ef5574f
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Jun 21, 2023
598a389
Add more test and fix some bugs
coletdjnz Jun 22, 2023
da4bdb7
Add tests for `Request`
coletdjnz Jun 22, 2023
21930bd
Merge remote-tracking branch 'origin/network-overhaul' into network-o…
coletdjnz Jun 22, 2023
8ba34c2
Use new Request and network exceptions in update.py
coletdjnz Jun 22, 2023
61f86e2
use Request in external downloader
coletdjnz Jun 22, 2023
399a384
don't use HEADRequest in extractor common
coletdjnz Jun 22, 2023
bd35bff
Don't use update_Request in extractor common
coletdjnz Jun 22, 2023
164468f
RequestDirector only stores one instance of each rh_key
coletdjnz Jun 23, 2023
f7a0123
Do not use deprecated functions
coletdjnz Jun 23, 2023
e96dd33
Avoid use of deprecated utils.PUTRequest
coletdjnz Jun 23, 2023
ac59602
fix tests
coletdjnz Jun 23, 2023
7756914
fix functools cached_property usage in YoutubeDL
coletdjnz Jun 23, 2023
7f24a78
Fix compat dict_values for request director for 3.7
coletdjnz Jun 23, 2023
6a93fbf
does this fix windows
coletdjnz Jun 23, 2023
1282e90
delete
coletdjnz Jun 23, 2023
6325a27
Revert "delete"
coletdjnz Jun 23, 2023
f6ff081
Revert "does this fix windows"
coletdjnz Jun 23, 2023
b620f3d
now will this work?
coletdjnz Jun 23, 2023
33b3154
fix test helper import
coletdjnz Jun 23, 2023
ae56074
add tests for Response
coletdjnz Jun 24, 2023
bdbcd56
Lint tests
coletdjnz Jun 24, 2023
de5537d
Lint and isort yt-dlp
coletdjnz Jun 24, 2023
35ec307
add request handlers to debug header
coletdjnz Jun 24, 2023
41310aa
cleanup
coletdjnz Jun 24, 2023
78a702a
fix bug (thx tests)
coletdjnz Jun 24, 2023
6906094
improve RequestHandler doc
coletdjnz Jun 24, 2023
0d8360f
cleanup director
coletdjnz Jun 24, 2023
f4fe4c8
Only use annotations future import where required
coletdjnz Jun 24, 2023
337a40e
More cleanup
coletdjnz Jun 24, 2023
fb09098
more cleanup (very descriptive commit name)
coletdjnz Jun 24, 2023
162c690
actually fix panopto
coletdjnz Jun 24, 2023
8e04a95
Merge remote-tracking branch 'origin/master' into features/network-re…
pukkandan Jun 25, 2023
21e1acf
lint
pukkandan Jun 25, 2023
f24775a
Simplify compat
pukkandan Jun 25, 2023
3415a1f
oops, that's not a 3.7 feature
pukkandan Jun 25, 2023
54f121c
Clean headers and proxies when building request handlers
coletdjnz Jun 6, 2023
2624590
Support socks5h proxies
coletdjnz Jun 26, 2023
5a74099
Simplify InstanceStoreMixin
coletdjnz Jun 28, 2023
1376d04
linter
coletdjnz Jun 28, 2023
a404824
Add deprecation warnings for deprecated functions
coletdjnz Jun 28, 2023
2ff7296
ignore deprecation warnings for test response compat
coletdjnz Jun 28, 2023
77f0ef7
Fix use of deprecated Response methods in core
coletdjnz Jun 29, 2023
8f6243d
add _close_instance method to InstanceStoreMixin
coletdjnz Jun 29, 2023
f5dfbdd
Move Request to common.py
coletdjnz Jun 29, 2023
9114878
Move Response to common.py
coletdjnz Jun 29, 2023
4f857ed
Improve Request.url cleaning and add tests
coletdjnz Jun 29, 2023
f616f72
cleanup select_proxy and bypass_proxies
coletdjnz Jun 30, 2023
35c25a7
Fix linter
Grub4K Jul 1, 2023
8f4328f
Remove use of deprecated functions/attributes
Grub4K Jul 1, 2023
a4fe1dc
enable request handler checks by default
coletdjnz Jul 2, 2023
854c5fd
Update yt_dlp/networking/utils.py
coletdjnz Jul 2, 2023
88b8e0b
Update yt_dlp/networking/common.py
coletdjnz Jul 2, 2023
104cbd4
CaseInsensitiveDict inherits dict as mixin
coletdjnz Jul 2, 2023
2e89c4c
remove infojson encoder/decoder for case insensitive dict
coletdjnz Jul 2, 2023
d41845e
move urllib_req_to_req to compat
coletdjnz Jul 2, 2023
96645a2
Update yt_dlp/networking/__init__.py
coletdjnz Jul 2, 2023
cd296c4
newline
coletdjnz Jul 2, 2023
13117c2
Merge remote-tracking branch 'origin/network-overhaul' into network-o…
coletdjnz Jul 2, 2023
f7deac0
Update yt_dlp/networking/common.py
coletdjnz Jul 2, 2023
edab647
copy headers in build_request_director
coletdjnz Jul 2, 2023
0863fda
move around networking tests
coletdjnz Jul 2, 2023
ba2f8c9
merge build request handler tests into youtubedl networking tests
coletdjnz Jul 2, 2023
233e573
raise DeprecationWarning for _opener
coletdjnz Jul 2, 2023
b8772ec
Rewrite RH validation tests
coletdjnz Jul 2, 2023
dfd1c17
Improve RequestHandler test coverage
coletdjnz Jul 2, 2023
7428b4b
use HTTPSupportedRH for test
coletdjnz Jul 2, 2023
45cecd7
Break out urllib from HTTPError
coletdjnz Jul 2, 2023
b7f207a
try this
coletdjnz Jul 2, 2023
08000dc
remove redundant test
coletdjnz Jul 2, 2023
9313c59
Ignore for pypy
coletdjnz Jul 2, 2023
df3f2d1
Add deprecation warnings to CompatHTTPError and cleanup
coletdjnz Jul 2, 2023
c8a2bf0
Move CompatHTTPError to exceptions and make private
coletdjnz Jul 3, 2023
391a557
Only raise DeprecationWarning for select attributes
coletdjnz Jul 3, 2023
af14ef8
fix test_compat_http
coletdjnz Jul 3, 2023
ac0590b
Add `_CompatIncompleteRead`
coletdjnz Jul 3, 2023
60925dc
Move wrap request errors to common and make private
coletdjnz Jul 3, 2023
58ff25e
improve grub todo
coletdjnz Jul 3, 2023
dccd486
Make request handler import functions private
coletdjnz Jul 3, 2023
81d2c1a
simplify response
coletdjnz Jul 3, 2023
132e2f8
remove typing
coletdjnz Jul 3, 2023
8e0423f
[rh/urllib] Prevent file object from being closed when urllib.error.H…
coletdjnz Jul 3, 2023
d202199
Replace/update HTTPError usage
bashonly Jul 3, 2023
afbe055
oops missed one
bashonly Jul 3, 2023
128b0f6
Remove _CompatIncompleteRead
coletdjnz Jul 3, 2023
ca80508
More HTTPError fixes
bashonly Jul 3, 2023
412b11e
Add back CertificateVerifyError
coletdjnz Jul 3, 2023
faa6239
Merge remote-tracking branch 'origin/network-overhaul' into network-o…
coletdjnz Jul 3, 2023
99008c9
fix invalid escape
coletdjnz Jul 3, 2023
341dda5
from e
coletdjnz Jul 3, 2023
a150b4f
linter
coletdjnz Jul 3, 2023
803d47f
fix certificate error match
coletdjnz Jul 3, 2023
908079d
test for redirect loop
coletdjnz Jul 3, 2023
80a5ef1
timeout shouldn't occur in SSLError anymore
coletdjnz Jul 3, 2023
fbf3722
Merge remote-tracking branch 'origin/network-overhaul' into network-o…
coletdjnz Jul 3, 2023
a7e8afd
Test for SSLError to be raised
coletdjnz Jul 3, 2023
68ce808
Handle httplib validation errors
coletdjnz Jul 3, 2023
c7b300a
maybe not shutdown?
coletdjnz Jul 3, 2023
7a4a41c
remove ydl.to_debugtraffic, move handling to director/rh
coletdjnz Jul 3, 2023
938da74
fix test_ssl_error
coletdjnz Jul 3, 2023
2557a68
improve TestInstanceStoreMixin
coletdjnz Jul 3, 2023
aee3556
Add some more tests
coletdjnz Jul 3, 2023
f869a75
isort tests
coletdjnz Jul 3, 2023
f091697
raise request error when failing to load client certs
coletdjnz Jul 3, 2023
58432dd
remove test for ssl_load_certs
coletdjnz Jul 3, 2023
459c780
remove unused branch in SocksConnection
coletdjnz Jul 3, 2023
4a044cc
isort and linter
coletdjnz Jul 3, 2023
1ab6b43
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Jul 3, 2023
f8dab08
Fix youtube.py use of e.cause
coletdjnz Jul 3, 2023
0b154cf
[rh/urllib] fix content-X headers not being removed on redirect
coletdjnz Jul 3, 2023
e338f3e
use RequestError instead of YoutubeDLerror for re-raising exceptions …
coletdjnz Jul 4, 2023
3a72b92
Update yt_dlp/YoutubeDL.py
coletdjnz Jul 4, 2023
f2fb2f9
Update yt_dlp/YoutubeDL.py
coletdjnz Jul 4, 2023
d359f22
[rh/urllib] Chain HTTPError
coletdjnz Jul 4, 2023
575a847
Merge remote-tracking branch 'origin/network-overhaul' into network-o…
coletdjnz Jul 4, 2023
a794233
[fd/aria2c] don't use Ytdl-request-proxy
coletdjnz Jul 4, 2023
3033529
isort downloaders
coletdjnz Jul 4, 2023
25536e4
Add deprecation warnings when trying to pass urllib.request.Request t…
coletdjnz Jul 4, 2023
20123e4
single quotes
coletdjnz Jul 4, 2023
eb13e8a
Update test/test_networking.py
coletdjnz Jul 4, 2023
345fb8a
Remove AutoCloseMixin
coletdjnz Jul 4, 2023
ae129c7
Refactor response to explicitly take a file-like object
coletdjnz Jul 4, 2023
7aa1847
Merge remote-tracking branch 'origin/network-overhaul' into network-o…
coletdjnz Jul 4, 2023
a9d6aac
removes some typing
coletdjnz Jul 4, 2023
64e8e5c
improve director doc
coletdjnz Jul 4, 2023
83ca336
Merge remote-tracking branch 'upstream/master' into network-overhaul
coletdjnz Jul 7, 2023
e933c72
Cleanup after merge
coletdjnz Jul 7, 2023
0d24723
Revert unrelated changes made by linter
pukkandan Jul 9, 2023
2f07530
Do not use warnings.warn
pukkandan Jul 9, 2023
9eacd4c
Cleanup
pukkandan Jul 9, 2023
34fadc6
Add logger shim
pukkandan Jul 9, 2023
45be7a0
Use logger
pukkandan Jul 9, 2023
9de981d
Let RH register themselves
pukkandan Jul 9, 2023
692a709
Simplify interface
pukkandan Jul 9, 2023
da36f90
Cleanup
pukkandan Jul 9, 2023
9d3f9dd
We are not using unittest
pukkandan Jul 9, 2023
479ed72
Fix --print-traffic
coletdjnz Jul 13, 2023
828aaba
Rename CaseInsensitiveDict to HTTPHeaderDict
coletdjnz Jul 13, 2023
d4069f0
add kwargs to RequestHandler
coletdjnz Jul 13, 2023
0c27764
isort
pukkandan Jul 15, 2023
c896026
Move HTTPHeaderDict
pukkandan Jul 15, 2023
4e8aeea
Move RequestDirector
pukkandan Jul 15, 2023
7b5d119
Expose objects from common
pukkandan Jul 15, 2023
6d7d8af
Cleanup
pukkandan Jul 15, 2023
5028fe5
Change temp logger to be a subset of planned API
pukkandan Jul 15, 2023
8e3bc89
Merge remote-tracking branch 'origin/master' into pr/2861
pukkandan Jul 15, 2023
e17fe9d
Split utils
pukkandan Jul 15, 2023
7ce8271
Fix deprecated typing
pukkandan Jul 15, 2023
a7a4b4d
Bring back test_client_certificate
pukkandan Jul 15, 2023
2478dd0
isort
pukkandan Jul 15, 2023
627df34
fix
pukkandan Jul 15, 2023
591f915
Revert unrelated changes
pukkandan Jul 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -76,7 +76,7 @@ offlinetest: codetest

# XXX: This is hard to maintain
CODE_FOLDERS = yt_dlp yt_dlp/downloader yt_dlp/extractor yt_dlp/postprocessor yt_dlp/compat \
yt_dlp/extractor/anvato_token_generator
yt_dlp/compat/urllib yt_dlp/extractor/anvato_token_generator yt_dlp/networking
yt-dlp: yt_dlp/*.py yt_dlp/*/*.py
mkdir -p zip
for d in $(CODE_FOLDERS) ; do \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -453,6 +453,8 @@ You can also fork the project on github and run your fork's [build workflow](.gi
--source-address IP Client-side IP address to bind to
-4, --force-ipv4 Make all connections via IPv4
-6, --force-ipv6 Make all connections via IPv6
--enable-file-protocol Enable file:// URLs. This is disabled by
default for security reasons.

## Geo-restriction:
--geo-verification-proxy URL Use this proxy to verify the IP address for
Expand Down
4 changes: 2 additions & 2 deletions test/test_YoutubeDL.py
Expand Up @@ -10,7 +10,6 @@

import copy
import json
import urllib.error

from test.helper import FakeYDL, assertRegexpMatches
from yt_dlp import YoutubeDL
Expand All @@ -25,6 +24,7 @@
int_or_none,
match_filter_func,
)
from yt_dlp.networking.exceptions import RequestError

TEST_URL = 'http://localhost/sample.mp4'

Expand Down Expand Up @@ -1100,7 +1100,7 @@ def test_selection(params, expected_ids, evaluate_all=False):
def test_urlopen_no_file_protocol(self):
# see https://github.com/ytdl-org/youtube-dl/issues/8227
ydl = YDL()
self.assertRaises(urllib.error.URLError, ydl.urlopen, 'file:///etc/passwd')
self.assertRaises(RequestError, ydl.urlopen, 'file:///etc/passwd')

def test_do_not_override_ie_key_in_url_transparent(self):
ydl = YDL()
Expand Down
2 changes: 1 addition & 1 deletion test/test_YoutubeDLCookieJar.py
Expand Up @@ -11,7 +11,7 @@
import re
import tempfile

from yt_dlp.utils import YoutubeDLCookieJar
from yt_dlp.cookies import YoutubeDLCookieJar


class TestYoutubeDLCookieJar(unittest.TestCase):
Expand Down
10 changes: 3 additions & 7 deletions test/test_download.py
Expand Up @@ -10,10 +10,7 @@

import collections
import hashlib
import http.client
import json
import socket
import urllib.error

from test.helper import (
assertGreaterEqual,
Expand All @@ -26,7 +23,6 @@
report_warning,
try_rm,
)

import yt_dlp.YoutubeDL # isort: split
from yt_dlp.extractor import get_info_extractor
from yt_dlp.utils import (
Expand All @@ -36,6 +32,7 @@
format_bytes,
join_nonempty,
)
from yt_dlp.networking.exceptions import TransportError, HTTPError

RETRIES = 3

Expand Down Expand Up @@ -161,8 +158,7 @@ def try_rm_tcs_files(tcs=None):
force_generic_extractor=params.get('force_generic_extractor', False))
except (DownloadError, ExtractorError) as err:
# Check if the exception is not a network related one
if (err.exc_info[0] not in (urllib.error.URLError, socket.timeout, UnavailableVideoError, http.client.BadStatusLine)
or (err.exc_info[0] == urllib.error.HTTPError and err.exc_info[1].code == 503)):
if not isinstance(err.exc_info[1], (TransportError, UnavailableVideoError)) or (isinstance(err.exc_info[1], HTTPError) and err.exc_info[1].code == 503):
err.msg = f'{getattr(err, "msg", err)} ({tname})'
raise

Expand Down Expand Up @@ -246,7 +242,7 @@ def try_rm_tcs_files(tcs=None):
# extractor returns full results even with extract_flat
res_tcs = [{'info_dict': e} for e in res_dict['entries']]
try_rm_tcs_files(res_tcs)

ydl.close()
return test_template


Expand Down
192 changes: 0 additions & 192 deletions test/test_http.py

This file was deleted.