Commit Graph

67 Commits

Author SHA1 Message Date
Mike Fährmann
e12b17649a [dl:ytdl] support '_ytdl_params' 2025-12-28 23:35:21 +01:00
Mike Fährmann
5427e337d4 [dl:ytdl] unset '_mtime_http' (#8767)
prevent an mtime value from a previous HTTP download
from being reused for a file downloaded by 'ytdl'
2025-12-28 22:46:52 +01:00
Mike Fährmann
207f6137c5 [dl:ytdl] fix "UnboundLocalError: 'tries'" (#8707)
fixes regression introduced in 402f53616b
2025-12-15 08:43:26 +01:00
Mike Fährmann
b891c0301e [dl:ytdl] improve error detection
- intercept ytdl logging messages and signal error when it
  emits an error message
- remove "ERROR:" etc from ytdl logging messages
2025-12-12 15:59:18 +01:00
Mike Fährmann
c2c00d1779 [dl:ytdl] forward '_ytdl_manifest_headers' to formats 2025-12-10 18:34:18 +01:00
Mike Fährmann
e3875127af [dl:ytdl] fix 'AttributeError' when ytdl returns None (#8660)
fixes regression introduced in 402f53616b
2025-12-08 18:39:30 +01:00
Mike Fährmann
402f53616b [dl:ytdl] implement 'retry' functionality (#1131 #8269)
for 'info_dict' extraction and file download
2025-12-04 20:43:10 +01:00
Mike Fährmann
1f6577240d [dl:ytdl] update '_extract_manifest()'
- use 'kwdict' as single argument
- fix '_parse_m3u8_formats_and_subtitles' arguments
2025-12-04 19:13:28 +01:00
Mike Fährmann
8f91daa9bc [dl:ytdl] improve error message when importing default ytdl modules 2025-12-04 18:28:09 +01:00
Mike Fährmann
918b06caf4 [dl:ytdl] restructure code 2025-12-04 18:14:27 +01:00
Mike Fährmann
8c62be343e [output] add 'Logger.traceback()' helper 2025-10-14 18:44:29 +02:00
Mike Fährmann
b9fd9103d4 [dl:ytdl] move 'http.cookiejar.Cookie' import to top of file 2025-09-05 13:43:46 +02:00
Mike Fährmann
1c9f4ff867 [dl:ytdl] support '_ytdl_manifest_cookies' 2025-09-02 22:12:51 +02:00
Mike Fährmann
5f9c8ee195 [dl:ytdl] pass 'ignoreerrors' as YoutubeDL param (#8085) 2025-08-22 23:12:26 +02:00
Mike Fährmann
1dcf6615b4 [dl:ytdl] improve playlist filename handling 2025-08-22 22:50:51 +02:00
Mike Fährmann
81df42103e [dl:ytdl] handle exceptions when processing playlists (#8085)
and prevent calling 'process_info()' with empty playlist entries
2025-08-22 22:32:46 +02:00
Mike Fährmann
9dfdeb05a7 [dl:ytdl] don't overwrite existing filenames (#7964) 2025-08-03 19:14:01 +02:00
Mike Fährmann
a097a373a9 simplify if statements by using walrus operators (#7671) 2025-07-22 20:57:54 +02:00
Mike Fährmann
ed64b484ff [ytdl] use '__gdl_initialize' key to trigger init code 2025-07-06 18:29:00 +02:00
Mike Fährmann
13ef48f04a [dl:ytdl] implement dynamic download 'rate' limits (#7638) 2025-07-05 23:07:42 +02:00
Mike Fährmann
e08ec7e083 update copyright notices 2025-06-13 00:03:41 +02:00
Mike Fährmann
811b665e33 remove @staticmethod decorators
There might have been a time when calling a static method was faster
than a regular method, but that is no longer the case. According to
micro-benchmarks, it is 70% slower in CPython 3.13 and it also makes
executing the code of a class definition slower.
2025-06-12 22:50:52 +02:00
Mike Fährmann
a798b8971e [dl:ytdl] fix postprocessing/merge errors (#7581)
don't use a hardcoded '.part' filename extension

fixes regression introduced in 29d315e495
2025-05-26 18:56:40 +02:00
Mike Fährmann
e05b82253a [dl:ytdl] support custom headers when fetching HLS/DASH manifests 2025-05-26 17:17:37 +02:00
Mike Fährmann
3e7a5fcb00 [dl:ytdl] fix crash when using legacy 'youtube_dl' (#6949)
https://github.com/mikf/gallery-dl/issues/6949#issuecomment-2906920039

fixes regression introduced in 29d315e495
2025-05-24 19:58:09 +02:00
Mike Fährmann
29d315e495 [dl:ytdl] improve temp/part file handling (#6949 #7494)
- fixes files not being moved from 'part-directory' (#6949)
- fixes 'skip: enumerate' overwriting files (#7494)
2025-05-21 13:50:07 +02:00
Mike Fährmann
1772c233e4 [dl:ytdl] fix exception when ytdl reports an error (#7301)
when using the HLS/DASH download functionality
2025-04-08 17:02:35 +02:00
Mike Fährmann
81a1b647bb [dl:ytdl] support processing inline HLS/DASH manifests (#6379 #7006) 2025-03-26 22:41:40 +01:00
Mike Fährmann
6c8c264cf5 [dl:ytdl] log ytdl module and version when importing 2025-02-28 21:18:42 +01:00
Mike Fährmann
f79e57b71e [dl:ytdl] change 'forward-cookies' default to 'true' (#6401, #6348)
revert dba87ca99e
2024-10-31 17:35:08 +01:00
Mike Fährmann
1824267447 [dl:ytdl] implement explicit HLS/DASH handling
add '_ytdl_manifest' to specify a manifest type to process
2024-10-16 15:16:21 +02:00
Mike Fährmann
a051e1c955 directly pass exception instances as 'exc_info' logger argument 2024-09-19 14:50:08 +02:00
Mike Fährmann
127aa45834 [ytdl] ignore SyntaxErrors when trying to import a module 2024-08-29 19:28:08 +02:00
Mike Fährmann
3ec7ee6baa [downloader:ytdl] fix exception due to missing 'ext' (#5675) 2024-06-02 18:16:53 +02:00
Mike Fährmann
8148c2a097 [downloader:ytdl] prevent exception on empty results
a7c7953107 (commitcomment-92042240)
2023-03-06 12:25:12 +01:00
Mike Fährmann
8124c16a50 split 'build_path' from 'set_filename' and 'set_extension'
Do not automatically build a new path
when setting file metadata or updating its extension.
2022-11-08 17:03:24 +01:00
Mike Fährmann
1aae9f2b71 [downloader:ytdl] update _set_outtmpl() (fixes #2692)
bf1824b391
2022-06-20 11:32:02 +02:00
Mike Fährmann
47cf05c4ab refactor proxy handling code (#2357)
- allow gallery-dl proxy settings to overwrite environment proxies
- allow specifying different proxies for data extraction and download
  - add 'downloader.proxy' option
  - '-o extractor.proxy=–PROXY_URL -o downloader.proxy=null'
    now has the same effect as youtube-dl's '--geo-verification-proxy'
2022-03-10 23:55:35 +01:00
Mike Fährmann
c0fddcefc5 [downloader:ytdl] make ImportErrors non-fatal (#2273) 2022-02-08 19:30:29 +01:00
Mike Fährmann
f4e3cee6ac use yt-dlp by default (#1850, #2028) 2021-11-29 18:24:26 +01:00
Mike Fährmann
19403a7fff [downloader:ytdl] prevent crash in '_progress_hook()' (#1680)
'speed' is not guaranteed to be defined or convertible to 'int'
2021-11-12 18:54:04 +01:00
Mike Fährmann
efa178cc91 [ytdl] implement parsing ytdl command-line options (#1680)
- adds 'config-file' and 'cmdline-args' options
  for both ytdl downloader and extractor
- create 'ytdl' helper module, which combines YoutubeDL creation
  and option parsing.
- most likely a buggy mess due to incompatibilities between the
  original youtube-dl and yt-dlp.
2021-11-07 02:44:11 +01:00
Mike Fährmann
232ab626a7 [downloader:ytdl] prevent crash in '_progress_hook()'
https://github.com/mikf/gallery-dl/discussions/1964#discussioncomment-1516702
2021-10-21 22:57:04 +02:00
Mike Fährmann
d0761454b1 implement a download progress indicator (#1519) 2021-09-28 22:48:58 +02:00
Mike Fährmann
f5b097165e [ytdl] transfer YoutubeDL objects to downloader (#1680)
allows specifying downloader-specific options per subcategory
but overwrites all downloader.ytdl settings
2021-07-16 15:40:54 +02:00
Mike Fährmann
fc19010808 [downloader:ytdl] fix 'outtmpl' setting for yt_dlp (#1680)
yt_dlp supports multiple outtmpl settings for different file types and
uses its 'outtmpl_dict' for that.
2021-07-16 15:05:16 +02:00
Mike Fährmann
e622e004f0 [ytdl] improve module imports (#1680)
Apply 'extractor.ytdl.module' for every URL, not just the first.
2021-07-14 03:08:00 +02:00
Mike Fährmann
36ac2197db [ytdl] add extractor for sites supported by youtube-dl
(#1680, #878)

Can be used by prefixing any URL with 'ytdl:',
or by setting 'extractor,ytdl.enabled' to 'true'.
2021-07-10 20:55:47 +02:00
Mike Fährmann
1a38fae785 add option to use different youtube-dl modules (fixes #1330)
by setting the 'downloader.ytdl.module' value. For example

{
    "downloader": {
        "ytdl": {
            "module": "yt_dlp"
        }
    }
}

or '-o module=yt_dlp'
2021-03-01 03:10:42 +01:00
Mike Fährmann
ac3036ef56 add 'filesize-min' and 'filesize-max' options (closes #780) 2020-09-03 18:21:04 +02:00