Исправление firkax, (текущая версия) :
Ну я не пойму, неужели это и правда сложно?
Сейчас проверю.
21:17 ищу в яндксе yt-dlp и скачиваю архив https://github.com/yt-dlp/yt-dlp/releases/download/2022.06.29/yt-dlp
21:18 unzip yt-dlp, выдало ошибку
23 extra bytes at beginning or within zipfile
mcedit yt-dlp.zip, жму F8 удалить шебанг, F2 сохраняю, Esc Esc выход
unzip yt-dlp.zip - успех, распаковалось в директорию yt_dlp
21:20 ищу твою ошибку
grep -RF «Retrying (attempt» yt_dlp
нашлось в yt_dlp/downloader/common.py
21:21 mcedit yt_dlp/downloader/common.py
F7, ввожу «Retrying (attempt»
первая строка про какие-то операции с файлами, она нам не нужна, ищу ещё раз (F7, enter)
нашло:
def report_retry(self, err, count, retries):
"""Report retry in case of HTTP error 5xx"""
self.__to_screen(
'[download] Got server HTTP error: %s. Retrying (attempt %d of %s) ...'
% (error_to_compat_str(err), count, self.format_retries(retries)))
self.sleep_retry('http', count)
$ grep -RF report_retry yt_dlp
yt_dlp/downloader/http.py: self.report_retry(e.source_error, count, retries)
yt_dlp/downloader/fragment.py: def report_retry_fragment(self, err, frag_index, count, retries):
yt_dlp/downloader/fragment.py: self.report_retry_fragment(err, frag_index, count, fragment_retries)
yt_dlp/downloader/common.py: def report_retry(self, err, count, retries):
yt_dlp/downloader/youtube_live_chat.py: self.report_retry_fragment(err, frag_index, count, fragment_retries)
yt_dlp/downloader/ism.py: self.report_retry_fragment(err, frag_index, count, fragment_retries)
21:24 mcedit yt_dlp/downloader/http.py
F7 «report_retry» enter
нашлось такое в конце файла
while count <= retries:
try:
establish_connection()
return download()
except RetryDownload as e:
count += 1
if count <= retries:
self.report_retry(e.source_error, count, retries)
else:
self.to_screen(f'[download] Got server HTTP error: {e.source_error}')
continue
except NextFragment:
continue
except SucceedDownload:
return True
self.report_error('giving up after %s retries' % retries)
return False
очевидно, можно просто убрать if count <= retries и заменить while count <= retries: на какое-нить while true: (не знаю можно ли так в питоне), но давай сделаем красивее и найдём откуда берётся retries - листаем вверх, а там
retries = self.params.get('retries', 0)
yt-dlp --help | grep retries
seconds (or range) to wait between retries
-R, --retries RETRIES Number of retries (default is 10), or
--file-access-retries RETRIES Number of times to retry on file access
--fragment-retries RETRIES Number of retries for a fragment (default
--extractor-retries RETRIES Number of retries for known extractor
21:29 и правда, на этом выясняем что можно ничего не патчить было а просто ставить -R 1000000
Итого 12 минут, из них наверно 5 на написание лога моих действий в этом сообщении.
Исходная версия firkax, :
Ну я не пойму, неужели это и правда сложно?
Сейчас проверю.
21:17 ищу в яндксе yt-dlp и скачиваю архив https://github.com/yt-dlp/yt-dlp/releases/download/2022.06.29/yt-dlp 21:18 unzip yt-dlp, выдало ошибку
23 extra bytes at beginning or within zipfile
def report_retry(self, err, count, retries):
"""Report retry in case of HTTP error 5xx"""
self.__to_screen(
'[download] Got server HTTP error: %s. Retrying (attempt %d of %s) ...'
% (error_to_compat_str(err), count, self.format_retries(retries)))
self.sleep_retry('http', count)
$ grep -RF report_retry yt_dlp
yt_dlp/downloader/http.py: self.report_retry(e.source_error, count, retries)
yt_dlp/downloader/fragment.py: def report_retry_fragment(self, err, frag_index, count, retries):
yt_dlp/downloader/fragment.py: self.report_retry_fragment(err, frag_index, count, fragment_retries)
yt_dlp/downloader/common.py: def report_retry(self, err, count, retries):
yt_dlp/downloader/youtube_live_chat.py: self.report_retry_fragment(err, frag_index, count, fragment_retries)
yt_dlp/downloader/ism.py: self.report_retry_fragment(err, frag_index, count, fragment_retries)
while count <= retries:
try:
establish_connection()
return download()
except RetryDownload as e:
count += 1
if count <= retries:
self.report_retry(e.source_error, count, retries)
else:
self.to_screen(f'[download] Got server HTTP error: {e.source_error}')
continue
except NextFragment:
continue
except SucceedDownload:
return True
self.report_error('giving up after %s retries' % retries)
return False
retries = self.params.get('retries', 0)
yt-dlp --help | grep retries
seconds (or range) to wait between retries
-R, --retries RETRIES Number of retries (default is 10), or
--file-access-retries RETRIES Number of times to retry on file access
--fragment-retries RETRIES Number of retries for a fragment (default
--extractor-retries RETRIES Number of retries for known extractor
21:29 и правда, на этом выясняем что можно ничего не патчить было а просто ставить -R 1000000
Итого 12 минут, из них наверно 5 на написание лога моих действий в этом сообщении.