mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-22 13:06:34 +00:00
Merge pull request #852 from tcely/patch-19
Create `fatal_http_errors.py` patch
This commit is contained in:
commit
78c5e5dd87
25
patches/yt_dlp/patch/fatal_http_errors.py
Normal file
25
patches/yt_dlp/patch/fatal_http_errors.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
from yt_dlp.extractor.youtube import YoutubeIE
|
||||||
|
|
||||||
|
|
||||||
|
class PatchedYoutubeIE(YoutubeIE):
|
||||||
|
|
||||||
|
def _download_player_responses(self, url, smuggled_data, video_id, webpage_url):
|
||||||
|
webpage = None
|
||||||
|
if 'webpage' not in self._configuration_arg('player_skip'):
|
||||||
|
query = {'bpctr': '9999999999', 'has_verified': '1'}
|
||||||
|
pp = self._configuration_arg('player_params', [None], casesense=True)[0]
|
||||||
|
if pp:
|
||||||
|
query['pp'] = pp
|
||||||
|
webpage = self._download_webpage_with_retries(webpage_url, video_id, retry_fatal=True, query=query)
|
||||||
|
|
||||||
|
master_ytcfg = self.extract_ytcfg(video_id, webpage) or self._get_default_ytcfg()
|
||||||
|
|
||||||
|
player_responses, player_url = self._extract_player_responses(
|
||||||
|
self._get_requested_clients(url, smuggled_data),
|
||||||
|
video_id, webpage, master_ytcfg, smuggled_data)
|
||||||
|
|
||||||
|
return webpage, master_ytcfg, player_responses, player_url
|
||||||
|
|
||||||
|
|
||||||
|
YoutubeIE.__unpatched___download_player_responses = YoutubeIE._download_player_responses
|
||||||
|
YoutubeIE._download_player_responses = PatchedYoutubeIE._download_player_responses
|
@ -18,6 +18,7 @@ from .hooks import postprocessor_hook, progress_hook
|
|||||||
from .utils import mkdir_p
|
from .utils import mkdir_p
|
||||||
import yt_dlp
|
import yt_dlp
|
||||||
import yt_dlp.patch.check_thumbnails
|
import yt_dlp.patch.check_thumbnails
|
||||||
|
import yt_dlp.patch.fatal_http_errors
|
||||||
from yt_dlp.utils import remove_end
|
from yt_dlp.utils import remove_end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user