Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"exec" option, but BEFORE downloading file #23921

Closed
zmechu opened this issue Feb 1, 2020 · 3 comments
Closed

"exec" option, but BEFORE downloading file #23921

zmechu opened this issue Feb 1, 2020 · 3 comments
Labels

Comments

@zmechu
Copy link

@zmechu zmechu commented Feb 1, 2020

Checklist

  • [ x] I'm reporting a feature request
  • [ x] I've verified that I'm running youtube-dl version 2020.01.24
  • [ x] I've searched the bugtracker for similar feature requests including closed ones

Description

WRITE DESCRIPTION HERE

There is "-exec CMD" option, which allows to "Execute a command on the file after downloading [...]".

I'm trying to make workaround for "429: Too Many Requests" error with proxy changing "on the fly". Means - changing proxy every youtube-dl run.

Is there a way to run any script/command BEFORE file downloading?

If no - I'm requesting for this feature.

@zmechu zmechu added the request label Feb 1, 2020
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 1, 2020

--exec operates on the final file and does not make any sense before download since the file does not exist. What you must do is catch 429 error and do a re-run.

@dstftw dstftw closed this Feb 1, 2020
@zmechu
Copy link
Author

@zmechu zmechu commented Feb 1, 2020

It makes a sense, in my opinion. In the case of 429 error I need to catch error code, write a script to re run etc.

My simplest idea is such:

  1. youtube-dl runs
  2. before fetching video file:
    2a. Got list 3-4 proxies (form file/list or sth like that)
    2b. Take (for example: random) one of them
    2c. Put selected proxy into youtube-dl.conf
  3. fetching youtube file
  4. end.

In this situation I'll get 429 error minimum 3-4x times less. Also, 3-4 IPs gives me chance to never got 429 error because of "IP distribution" (runs for example 100x youtube-dl from one IP leads to 429 error, running 25x from 4 IPs - never).

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 1, 2020

As already said you don't need any exec-before-download for such scenario.

@ytdl-org ytdl-org locked and limited conversation to collaborators Feb 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.