Skip to content

.py script via python.function #4870

Answered by mikf
masha9000 asked this question in Q&A
Dec 1, 2023 · 5 comments · 6 replies
Discussion options

You must be logged in to vote

To run this script after every yt-dlp download, you'd have to enable metadata-url and then check if a URL starts with ytdl:, which means it got downloaded by yt-dlp from another extractor.

{
    "extractor": {
        "metadata-url": "_url",

        "postprocessors": [
            {
                "name"    : "python",
                "event"   : "after",
                "filter"  : "_url.startswith('ytdl:')",
                "function": "%APPDATA%/gallery-dl/ytdl/json-regexp-yt.py:json_regexp"
            }
        ]
    }
}

(I'm using event: after to make sure yt-dlp is definitely done and has written all of its output files)

Regarding paths and download locations, you can enable meta…

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mikf
Comment options

mikf Dec 1, 2023
Maintainer

Comment options

You must be logged in to vote
1 reply
@mikf
Comment options

mikf Dec 4, 2023
Maintainer

Answer selected by masha9000
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@mikf
Comment options

mikf Dec 9, 2023
Maintainer

@Hrxn
Comment options

@mikf
Comment options

mikf Dec 9, 2023
Maintainer

@rautamiekka
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants