diff options
| author | 2025-07-31 01:22:07 -0400 | |
|---|---|---|
| committer | 2025-07-31 01:22:07 -0400 | |
| commit | d9539f96cc7ac112b7d8faad022190fbbc88c745 (patch) | |
| tree | 471249d60b9202c00d7d82abec8b296fc881292e /gallery_dl/update.py | |
| parent | 889fc15f272118bf277737b6fac29d3faeffc641 (diff) | |
| parent | a6e995c093de8aae2e91a0787281bb34c0b871eb (diff) | |
Update upstream source from tag 'upstream/1.30.2'
Update to upstream version '1.30.2'
with Debian dir f0dcd28a671f8600479182ff128e05ba8904a0d8
Diffstat (limited to 'gallery_dl/update.py')
| -rw-r--r-- | gallery_dl/update.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gallery_dl/update.py b/gallery_dl/update.py index 6650ec4..273ca18 100644 --- a/gallery_dl/update.py +++ b/gallery_dl/update.py @@ -1,13 +1,12 @@ # -*- coding: utf-8 -*- -# Copyright 2024 Mike Fährmann +# Copyright 2024-2025 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. import os -import re import sys from .extractor.common import Extractor, Message @@ -98,7 +97,7 @@ class UpdateJob(DownloadJob): import atexit import subprocess - cmd = 'ping 127.0.0.1 -n 5 -w 1000 & del /F "{}"'.format(path_old) + cmd = f'ping 127.0.0.1 -n 5 -w 1000 & del /F "{path_old}"' atexit.register( util.Popen, cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, @@ -184,17 +183,16 @@ class UpdateExtractor(Extractor): tag = channel exact = True - if re.match(r"\d\.\d+\.\d+", tag): + if util.re_compile(r"\d\.\d+\.\d+").match(tag): tag = "v" + tag try: path_repo = REPOS[repo or "stable"] except KeyError: - raise exception.StopExtraction("Invalid channel '%s'", repo) + raise exception.AbortExtraction(f"Invalid channel '{repo}'") path_tag = tag if tag == "latest" else "tags/" + tag - url = "{}/repos/{}/releases/{}".format( - self.root_api, path_repo, path_tag) + url = f"{self.root_api}/repos/{path_repo}/releases/{path_tag}" headers = { "Accept": "application/vnd.github+json", "User-Agent": util.USERAGENT, @@ -211,8 +209,8 @@ class UpdateExtractor(Extractor): else: binary_name = BINARIES[repo][binary] - url = "{}/{}/releases/download/{}/{}".format( - self.root, path_repo, data["tag_name"], binary_name) + url = (f"{self.root}/{path_repo}/releases/download" + f"/{data['tag_name']}/{binary_name}") yield Message.Directory, data yield Message.Url, url, data |
