aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2020-08-15 22:00:07 +0200
committerneodarz <neodarz@neodarz.net>2020-08-15 22:00:07 +0200
commitac9eaf5c4fcaf6d41804dc67a17ccb77a99e1668 (patch)
treef3fb6cc843077cee1b0dec01b45c72e8b21e9a4f
parent7d94b679a37e6c0dd84bf3234416790a0a6243f5 (diff)
downloadmusic_downloader-ac9eaf5c4fcaf6d41804dc67a17ccb77a99e1668.tar.xz
music_downloader-ac9eaf5c4fcaf6d41804dc67a17ccb77a99e1668.zip
Ignore some error when downloading
Diffstat (limited to '')
-rw-r--r--extractors/common.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/extractors/common.py b/extractors/common.py
index da3e59c..0287496 100644
--- a/extractors/common.py
+++ b/extractors/common.py
@@ -1,7 +1,7 @@
import os
import re
from pathlib import Path
-from sh import youtube_dl
+from sh import youtube_dl, ErrorReturnCode_1
from utils import read_file, write_file
@@ -36,12 +36,16 @@ class Extractor():
write_file(cache_file, self.root + "," + self.__class__.__name__)
def _yt_wrapper(self, url, output):
- for line in youtube_dl(
- url, audio_format="mp3",
- add_metadata=True,
- o=output + self.filename_template,
- _iter=True):
- print(line.strip())
+ try:
+ for line in youtube_dl(
+ url, audio_format="mp3",
+ add_metadata=True,
+ o=output + self.filename_template,
+ ignore_errors=True,
+ _iter=True):
+ print(line.strip())
+ except ErrorReturnCode_1:
+ pass
def download_albums(self, output):
for album in self._albums: