mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
pylint fixes
This commit is contained in:
parent
ce2fab9c7e
commit
3872ccb435
@ -92,9 +92,9 @@ class DownloadJob():
|
|||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
self.print_skip(path)
|
self.print_skip(path)
|
||||||
return
|
return
|
||||||
dl = self.get_downloader(url)
|
downloader = self.get_downloader(url)
|
||||||
self.print_start(path)
|
self.print_start(path)
|
||||||
tries = dl.download(url, path)
|
tries = downloader.download(url, path)
|
||||||
self.print_success(path, tries)
|
self.print_success(path, tries)
|
||||||
|
|
||||||
def set_directory(self, msg):
|
def set_directory(self, msg):
|
||||||
@ -154,7 +154,7 @@ class ExtractorFinder():
|
|||||||
def find_pattern_match(self, url):
|
def find_pattern_match(self, url):
|
||||||
for category in self.config:
|
for category in self.config:
|
||||||
for key, value in self.config[category].items():
|
for key, value in self.config[category].items():
|
||||||
if(key.startswith("regex")):
|
if key.startswith("regex"):
|
||||||
print(value)
|
print(value)
|
||||||
match = re.match(value, url)
|
match = re.match(value, url)
|
||||||
if match:
|
if match:
|
||||||
@ -165,7 +165,7 @@ class ExtractorFinder():
|
|||||||
match = re.match(pattern, url)
|
match = re.match(pattern, url)
|
||||||
if match:
|
if match:
|
||||||
return name, match
|
return name, match
|
||||||
return None
|
return None, None
|
||||||
|
|
||||||
def extractor_metadata(self):
|
def extractor_metadata(self):
|
||||||
path = os.path.join(os.path.dirname(__file__), "extractor")
|
path = os.path.join(os.path.dirname(__file__), "extractor")
|
||||||
@ -178,16 +178,16 @@ class ExtractorFinder():
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def get_info_dict(extractor_path):
|
def get_info_dict(extractor_path):
|
||||||
try:
|
try:
|
||||||
with open(extractor_path) as f:
|
with open(extractor_path) as file:
|
||||||
for index in range(30):
|
for _ in range(30):
|
||||||
line = next(f)
|
line = next(file)
|
||||||
if line.startswith("info ="):
|
if line.startswith("info ="):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
info = [line[6:]]
|
info = [line[6:]]
|
||||||
for line in f:
|
for line in file:
|
||||||
info.append(line)
|
info.append(line)
|
||||||
if line.startswith("}"):
|
if line.startswith("}"):
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user