A thing to allow to use YouTube-dlp with Hydrus Network
- Python 3.10+
- ffmpeg
pip install -r /install/requirements.txtfastapi run main.pydocker build -t hydrus-ytdl-proxy .
docker run -d -p 4458:4458 hydrus-ytdl-proxy- Add as NIXPACK
- Set start command to
fastapi run main.py --port=4458 - Set network port to
4458.
- Open Hydrus Network
- Go to network ➔ downloader components ➔ manage gallery url generators… and click on Add to add a new one with the following settings:
- name:
HydrusYTDLProxy url - url template:
http://<YOUR_SERVER_HOST_OR_IP>:4458/meta?url={url}- Replace
<YOUR_SERVER_HOST_OR_IP>with your server's host or IP address,
or localhost if you are running it on the same machine as Hydrus Network. - Use
httpsinstead ofhttpif you have ssl configured (Coolify does that), then you should also drop or adapt the port (:4458). - Adapt the port
4458if you run the server on a different port.
- Replace
- replacement phrase:
{url} - search term separator: empty
- initial search text (to prompt user):
url to download - example text search:
https://www.youtube.com/watch?v=dQw4w9WgXcQor - example request url: _automatically generated:
http://<YOUR_SERVER_HOST_OR_IP>:4458/meta?url=https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f3330 - matches as a: automatically generated
- Initially empty.
- Later will be
Matched HydrusYTDLProxy (meta as gallery) url class..
- OK
- name:
- Go to network ➔ downloader components ➔ manage parsers… and click on add to add a new one with the following settings:
- name or description (optional):
HydrusYTDLProxy (meta) - example urls ➔ add:
http://<YOUR_SERVER_HOST_OR_IP>:4458/meta?url=https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f3330 - fetch test data from url: same as above
- click on fetch test data from url
- set up parsers.
- add
- ➔ name or description(optional):
URL (best format) - content type: urls
- url type: url to download/pursue (file/post url)
- url quality precedence (higher is better):
75 - edit formula (type JSON, otherwise click change formula type)
- name/description:
URL (best format) from json - add the following 3 steps:
- dictionary entry by key:
- match type: fixed characters
- fixed text:
formats
- dictionary entry by key:
- match type: fixed characters
- fixed text:
best
- dictionary entry by key:
- match type: fixed characters
- fixed text:
url
- dictionary entry by key:
- content to fetch: string
- no string processing.
- name/description:
- ➔ name or description(optional):
- You can add more parsers if you want, e.g. for title, description, tags, other formats, etc.
- See http://<YOUR_SERVER_HOST_OR_IP>:4458/docs for available fields for the /meta endpoint.
- OK
- name or description (optional):
- Go to network ➔ downloader components ➔ manage parsers… and click on add to add a new one with the following settings:
- name or description (optional):
HydrusYTDLProxy (redirect) - example urls ➔ add:
https://www.pornhub.com/view_video.php?viewkey=ph63348bf2f3330 - fetch test data from url: same as above
- click on fetch test data from url
- set up parsers: add
- name or description(optional):
URL: Redirect to API (click edit formula twice to edit domain) - content type: urls
- url type: url to download/pursue (file/post url)
- url quality precedence (higher is better):
50 - edit formula (type ZIPPER, otherwise click change formula type)
- name/description:
Zipper rule to build the new url to redirect to the API. - add the following 3 zipped parts:
- Zipper (start of url)
- change formula type ➔ change to a new ZIPPER formula…
- edit formula
- name/description:
EDIT HOST HERE IN "substitution phrase" - add
- change formula type ➔ change to a new CONTEXT VARIABLE formula…
- edit formula
- name/description:
url - variable name:
url - no string processing.
- apply
- name/description:
- apply
- substitution phrase:
http://<YOUR_SERVER_HOST_OR_IP>:4458 - apply
- name/description:
- apply
- Zipper (middle part of url)
- change formula type ➔ change to a new ZIPPER formula…
- edit formula
- name/description:
middle part of url - add
- change formula type ➔ change to a new CONTEXT VARIABLE formula…
- edit formula
- name/description:
url - variable name:
url - no string processing.
- apply
- name/description:
- apply
- substitution phrase:
/meta?url= - apply
- name/description:
- apply
- Context variable (middle part of url)
- change formula type ➔ change to a new CONTEXT VARIABLE formula…
- edit formula
- name/description:
encoded url - variable name:
url - Click no string processing.
- Click add
- Select String Converter
- example string:
https://www.pornhub.com/view_video.php?viewkey=ph63348bf2f3330 - Click add
- conversion type: encode
- encoding type: url percent encoding
- example string:
https://www.pornhub.com/view_video.php?viewkey=ph63348bf2f3330 - converted string: automatically generated:
https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f3330 - apply
- apply
- apply
- Click add
- apply
- name/description:
- apply
- fixed text:
formats
- dictionary entry by key:
- match type: fixed characters
- fixed text:
best
- dictionary entry by key:
- match type: fixed characters
- fixed text:
url
- Zipper (start of url)
- substitution phrase:
\1\2\3 - no string processing.
- apply
- name/description:
- apply
- name or description(optional):
- set up parsers: add
- name or description(optional):
URL: just the given url for association - content type: urls
- url type: POST parsers only: url to associate (source url)
- url quality precedence (higher is better):
100 - edit formula (type CONTEXT VARIABLE, otherwise click change formula type before)
- name/description:
Original URL for association - variable name:
url - apply
- apply
- name/description:
- apply
- name or description(optional):
- apply
- name or description (optional):
- Go to network ➔ downloader components ➔ manage url classes
- and click on add to add a new one with the following settings:
- name:
HydrusYTDLProxy (meta) - url type: post url
- tab march rules
- preferred scheme: http (or https if you have ssl configured)
- network location:
<YOUR_SERVER_HOST_OR_IP>:4458 - path components: none
- parameters ➔ add
- name:
url - name, %-encoded:
url - match type: regex
- regex:
https?(:|%3A)(/|%2F)(/|%2F).+ - minimum allowed number of characters: ☑️ no limit
- maximum allowed number of characters: ☑️ no limit
- example string:
https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f3330 - default value: ☑️ none
- default value, %-encoded: ☑️ none
- default string processor: no string processing.
- apply
- name:
- tab options
- if matching by subdomain, keep it when normalising: Disabled.
No ◻️ - alphabetise GET parameters when normalising: Yes ☑️
- disallow match on any extra path components: No ◻️
- disallow match on any extra parameters: No ◻️
- keep extra parameters for server: Yes ☑️
- keep fragment when normalising: No ◻️
- post page can produce multiple files: No ◻️
- associate a 'known url' with resulting files: Yes ☑️
- optional api/redirect url conversion: no string conversion.
- api/redirect url: none set.
- send referral url: send referral url if available
- if matching by subdomain, keep it when normalising: Disabled.
- example url:
http://<YOUR_SERVER_HOST_OR_IP>:4458/meta?url=https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f3330 - apply
- name:
- and click on add to add a new one with the following settings:
- name:
HydrusYTDLProxy (meta as gallery) - url type: gallery url
- tab march rules
4. preferred scheme: http (or https if you have ssl configured)
5. network location:
<YOUR_SERVER_HOST_OR_IP>:44586. path components: none 7. parameters ➔ add 2. name:url3. name, %-encoded:url4. match type: regex 5. regex:https?(:|%3A)(/|%2F)(/|%2F).+6. minimum allowed number of characters: ☑️ no limit 7. maximum allowed number of characters: ☑️ no limit 8. example string:https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f33309. default value: ☑️ none 9. default value, %-encoded: ☑️ none 10. default string processor: no string processing. 11. apply - tab options
- if matching by subdomain, keep it when normalising: Disabled.
No ◻️ - alphabetise GET parameters when normalising: Yes ☑️
- disallow match on any extra path components: No ◻️
- disallow match on any extra parameters: No ◻️
- keep extra parameters for server: Yes ☑️
- keep fragment when normalising: No ◻️
- post page can produce multiple files: Disabled.
No ◻️ - associate a 'known url' with resulting files: Yes ☑️
- optional api/redirect url conversion: no string conversion.
- api/redirect url: none set.
- send referral url: send referral url if available
- if matching by subdomain, keep it when normalising: Disabled.
- example url:
http://<YOUR_SERVER_HOST_OR_IP>:4458/meta?url=https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f3330 - apply
- name:
- and click on add to add a new one with the following settings:
- name:
HydrusYTDLProxy (dl) - url type: file url
- tab march rules
- preferred scheme: http (or https if you have ssl configured)
- network location:
<YOUR_SERVER_HOST_OR_IP>:4458 - path components ➔ add
- match type: fixed characters
- fixed text:
dl - apply
- parameters ➔ add
- name:
format - name, %-encoded:
format - match type: character set
- match type: alphanumeric characters (a-zA-Z0-9)
- regex:
https?(:|%3A)(/|%2F)(/|%2F).+ - minimum allowed number of characters: ☑️ no limit
- maximum allowed number of characters: ☑️ no limit
- example string:
value - default value: ☑️ none
- default value, %-encoded: ☑️ none
- default string processor: no string processing.
- apply
- name:
- parameters ➔ add
- name:
url - name, %-encoded:
url - match type: regex
- regex:
https?(:|%3A)(/|%2F)(/|%2F).+ - minimum allowed number of characters: ☑️ no limit
- maximum allowed number of characters: ☑️ no limit
- example string:
https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f3330 - default value: ☑️ none
- default value, %-encoded: ☑️ none
- default string processor: no string processing.
- apply
- name:
- tab options
- if matching by subdomain, keep it when normalising: Disabled.
No ◻️ - alphabetise GET parameters when normalising: Yes ☑️
- disallow match on any extra path components: No ◻️
- disallow match on any extra parameters: No ◻️
- keep extra parameters for server: Yes ☑️
- keep fragment when normalising: No ◻️
- post page can produce multiple files: Disabled.
No ◻️ - associate a 'known url' with resulting files: Yes ☑️
- optional api/redirect url conversion: no string conversion.
- api/redirect url: none set.
- send referral url: send referral url if available
- if matching by subdomain, keep it when normalising: Disabled.
- example url:
http://<YOUR_SERVER_HOST_OR_IP>:4458/dl?url=https%3A%2F%2Fwww.pornhub.com%2Fview_video.php%3Fviewkey%3Dph63348bf2f3330&format=best - apply
- name:
- and click on add to add a new one with the following settings:
- Now you can use the new url generator in Hydrus Network:
- Open a new page ➔ downloader ➔ gallery
- Select `HydrusYTDLProxy url from the dropdown menu.
- Paste any YT-DLP / Youtube-dl supported URL into the search box.