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

default youtube-dl to use ipv4 #3311

Merged
merged 6 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ import:
videos:
http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html
enabled: false
# IPv6 is very strongly rate-limited on most sites supported by youtube-dl
forceipv4:
enabled: true
# You can use an HTTP/HTTPS/SOCKS proxy with youtube-dl
proxy:
enabled: false
Expand Down
3 changes: 3 additions & 0 deletions config/production.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ import:
videos:
http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html
enabled: false
# IPv6 is very strongly rate-limited on most sites supported by youtube-dl
forceipv4:
enabled: true
# You can use an HTTP/HTTPS/SOCKS proxy with youtube-dl
proxy:
enabled: false
Expand Down
1 change: 1 addition & 0 deletions server/helpers/youtube-dl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const processOptions = {
function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> {
return new Promise<YoutubeDLInfo>((res, rej) => {
let args = opts || [ '-j', '--flat-playlist' ]
if (CONFIG.IMPORT.VIDEOS.HTTP.FORCEIPV4) args.push('--force-ipv4')
args = wrapWithProxyOptions(args)

safeGetYoutubeDL()
Expand Down
3 changes: 3 additions & 0 deletions server/initializers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ const CONFIG = {
VIDEOS: {
HTTP: {
get ENABLED () { return config.get<boolean>('import.videos.http.enabled') },
FORCEIPV4: {
get ENABLED () { return config.get<boolean>('import.videos.http.forceipv4.enabled') }
},
PROXY: {
get ENABLED () { return config.get<boolean>('import.videos.http.proxy.enabled') },
get URL () { return config.get<string>('import.videos.http.proxy.url') }
Expand Down