[cleanup] Misc fixes and cleanup

Closes #3780, Closes #3853, Closes #3850
This commit is contained in:
pukkandan
2022-05-27 04:36:23 +05:30
parent 8246f8402b
commit 8a82af3511
16 changed files with 103 additions and 84 deletions

View File

@@ -610,8 +610,7 @@ class InfoExtractor:
if ip_block:
self._x_forwarded_for_ip = GeoUtils.random_ipv4(ip_block)
self._downloader.write_debug(
'[debug] Using fake IP %s as X-Forwarded-For' % self._x_forwarded_for_ip)
self.write_debug(f'Using fake IP {self._x_forwarded_for_ip} as X-Forwarded-For')
return
# Path 2: bypassing based on country code

View File

@@ -27,7 +27,7 @@ class CuriosityStreamBaseIE(InfoExtractor):
auth_cookie = self._get_cookies('https://curiositystream.com').get('auth_token')
if auth_cookie:
self.write_debug('Obtained auth_token cookie')
self._auth_token = cookie.value
self._auth_token = auth_cookie.value
if self._auth_token:
headers['X-Auth-Token'] = self._auth_token
result = self._download_json(

View File

@@ -1,9 +1,7 @@
import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
)
from ..compat import compat_parse_qs
from ..dependencies import websockets
from ..utils import (
ExtractorError,
@@ -209,7 +207,7 @@ class FC2LiveIE(InfoExtractor):
'User-Agent': self.get_param('http_headers')['User-Agent'],
})
self.write_debug('[debug] Sending HLS server request')
self.write_debug('Sending HLS server request')
while True:
recv = ws.recv()
@@ -231,13 +229,10 @@ class FC2LiveIE(InfoExtractor):
if not data or not isinstance(data, dict):
continue
if data.get('name') == '_response_' and data.get('id') == 1:
self.write_debug('[debug] Goodbye.')
self.write_debug('Goodbye')
playlist_data = data
break
elif self._downloader.params.get('verbose', False):
if len(recv) > 100:
recv = recv[:100] + '...'
self.to_screen('[debug] Server said: %s' % recv)
self.write_debug('Server said: %s%s' % (recv[:100], '...' if len(recv) > 100 else ''))
if not playlist_data:
raise ExtractorError('Unable to fetch HLS playlist info via WebSocket')