• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

Solved [NOT A BUG] youtube-dl slow download rate

odinti

Donor
is awesome!
Insider
I just found an easy temporary fix that works for me. Might be easier than using that patch that just got posted in the meantime...

We replace the youtube-dl file by a middleman.
Change your config.ini to point at the new file youtube-dl2.

INI:
YoutubeDLPath2 = "/usr/local/bin/youtube-dl"
YoutubeDLPath = "./youtube-dl2"
(I left the original line there too so I dont forget about it when i want to disable this workaround. But you can remove the first line if you want.)

Create the file youtube-dl2 in the same folder:

Bash:
#!/bin/bash
youtube-dl ${@/bestaudio/43}

Ans use
Bash:
chmod +x youtube-dl2
to make it executable.

That file replaces the -f bestaudio flag for the download to -f 43. Format 43 seems to be the .webm format which is not throttled by youtube.

Hope it helps anyone.

edit: It does not seem to work for every video as some are not available in format 43 but it worked most of the time for me now...

You are the hero we need but don't deserve, thank you very much
 

Zeldri

Member
Config.ini
Bash:
TS3Path = "/opt/sinusbot/TeamSpeak3-Client-linux_amd64/ts3client_linux_amd64"
ListenHost = "0.0.0.0"
DataDir = "/opt/sinusbot/data/"
ListenPort = 8087
LocalPlayback = false
EnableLocalFS = false
MaxBulkOperations = 300
LogLevel = 3
EnableProfiler = false
YoutubeDLPath2 = "/opt/sinusbot/youtube-dl"
YoutubeDLPath = "/opt/sinusbot/youtube-dl2"
EnableDebugConsole = false
UploadLimit = 83886080
RunAsUser = 0
RunAsGroup = 0
InstanceActionLimit = 6
UseSSL = false
SSLKeyFile = ""
SSLCertFile = ""
Hostname = ""
HostnameMask = ""
SampleInterval = 60
StartVNC = false
EnableWebStream = false
LogFile = ""
LicenseKey = "0DzfeXe8XjpN/UIiRq4z/If9UpWBN2I13oMkqe38GQo="
IsProxied = false
DenyStreamURLs = []
Pragma = 0

[YoutubeDL]
  BufferSize = 5242880
  MaxDownloadSize = 4194304000
  MaxDownloadRate = 1048576000
  CacheStreamed = false

1516907626505.png
And before it's worked
 

R3v07v3R

Active Member
Config.ini
Bash:
TS3Path = "/opt/sinusbot/TeamSpeak3-Client-linux_amd64/ts3client_linux_amd64"
ListenHost = "0.0.0.0"
DataDir = "/opt/sinusbot/data/"
ListenPort = 8087
LocalPlayback = false
EnableLocalFS = false
MaxBulkOperations = 300
LogLevel = 3
EnableProfiler = false
YoutubeDLPath2 = "/opt/sinusbot/youtube-dl"
YoutubeDLPath = "/opt/sinusbot/youtube-dl2"
EnableDebugConsole = false
UploadLimit = 83886080
RunAsUser = 0
RunAsGroup = 0
InstanceActionLimit = 6
UseSSL = false
SSLKeyFile = ""
SSLCertFile = ""
Hostname = ""
HostnameMask = ""
SampleInterval = 60
StartVNC = false
EnableWebStream = false
LogFile = ""
LicenseKey = "0DzfeXe8XjpN/UIiRq4z/If9UpWBN2I13oMkqe38GQo="
IsProxied = false
DenyStreamURLs = []
Pragma = 0

[YoutubeDL]
  BufferSize = 5242880
  MaxDownloadSize = 4194304000
  MaxDownloadRate = 1048576000
  CacheStreamed = false

View attachment 1712
And before it's worked

From the top;

Step 1) Navigate to your Sinusbot Dir "/opt/sinusbot/"
Step 2) Create a new file in your Sinusbot dir "youtube-dl2"
Step 3) Put this in the file you just created;
Code:
#!/bin/bash
youtube-dl ${@/bestaudio/43}
Step 4) Change your current line "YoutubeDLPath = "/opt/sinusbot/youtube-dl" to "YoutubeDLPath2 = "/opt/sinusbot/youtube-dl" in config.ini - so that you don't forget it later.
Step 5) Add line YoutubeDLPath = "./youtube-dl2" to config.ini
Step 6) Restart your bot service sinusbot restart
 

xuninho

Member
I just found an easy temporary fix that works for me. Might be easier than using that patch that just got posted in the meantime...

We replace the youtube-dl file by a middleman.
Change your config.ini to point at the new file youtube-dl2.

INI:
YoutubeDLPath2 = "/usr/local/bin/youtube-dl"
YoutubeDLPath = "./youtube-dl2"
(I left the original line there too so I dont forget about it when i want to disable this workaround. But you can remove the first line if you want.)

Create the file youtube-dl2 in the same folder:

Bash:
#!/bin/bash
youtube-dl ${@/bestaudio/43}

Ans use
Bash:
chmod +x youtube-dl2
to make it executable.

That file replaces the -f bestaudio flag for the download to -f 43. Format 43 seems to be the .webm format which is not throttled by youtube.

Hope it helps anyone.

edit: It does not seem to work for every video as some are not available in format 43 but it worked most of the time for me now...

Could you explain better how to do this on windows?
 

TomRiddle01

New Member
Could you explain better how to do this on windows?
No i can't, sorry. I dont use Windows at all. I should have clarified that it's just for linux.
The principle should be the same. It should be possible to create an executable file (maybe even a .bat file) and let it redirect to the real youtube-dl.
I'd be thankful if anyone else can post how to do the same on windows if they know how.
 

syaf

Member
I just found an easy temporary fix that works for me. Might be easier than using that patch that just got posted in the meantime...

We replace the youtube-dl file by a middleman.
Change your config.ini to point at the new file youtube-dl2.

INI:
YoutubeDLPath2 = "/usr/local/bin/youtube-dl"
YoutubeDLPath = "./youtube-dl2"
(I left the original line there too so I dont forget about it when i want to disable this workaround. But you can remove the first line if you want.)

Create the file youtube-dl2 in the same folder:

Bash:
#!/bin/bash
youtube-dl ${@/bestaudio/43}

Ans use
Bash:
chmod +x youtube-dl2
to make it executable.

That file replaces the -f bestaudio flag for the download to -f 43. Format 43 seems to be the .webm format which is not throttled by youtube.

Hope it helps anyone.

edit: It does not seem to work for every video as some are not available in format 43 but it worked most of the time for me now...
I did that step by step and now my bot is not even playing the songs. Before of that it was taking like 1 minute to play but now is not even working.
Can you help me?
 

xuninho

Member
No i can't, sorry. I dont use Windows at all. I should have clarified that it's just for linux.
The principle should be the same. It should be possible to create an executable file (maybe even a .bat file) and let it redirect to the real youtube-dl.
I'd be thankful if anyone else can post how to do the same on windows if they know how.


Any windows users please help.
 

flyth

is reticulating splines
Staff member
Developer
Contributor
As promised I looked into this and here's an interim version for linux that handles external programs like ytdl completely different and might solve the issues without needing an updated ytdl. Please be aware that this is a rather experimental release - should you have any issues with it, please let me know.

Also beware that you might need to revert any changes to your system you already did to fix the issue yourself (like the proposed workarounds).
 
As promised I looked into this and here's an interim version for linux that handles external programs like ytdl completely different and might solve the issues without needing an updated ytdl. Please be aware that this is a rather experimental release - should you have any issues with it, please let me know.

Also beware that you might need to revert any changes to your system you already did to fix the issue yourself (like the proposed workarounds).
http://prntscr.com/i6cf67
 

TomRiddle01

New Member
Please try to run this. It looks like the script you created does not execute correclty.

Code:
./youtube-dl2 -f bestaudio --o /home/sinusbot/ts3soundboard/data/tmp/316657a37d6cc5578516299f1e488dcd --restrict-filenames --max-downloads 1 --max-filesize 419430400 --rate-limit 104857600 --no-playlist --write-info-json --write-thumbnail --no-call-home oHg5SJYRHA0
 
As promised I looked into this and here's an interim version for linux that handles external programs like ytdl completely different and might solve the issues without needing an updated ytdl. Please be aware that this is a rather experimental release - should you have any issues with it, please let me know.

Also beware that you might need to revert any changes to your system you already did to fix the issue yourself (like the proposed workarounds).
Loop... Screenshot_1.png
 

gadund

Member
As promised I looked into this and here's an interim version for linux that handles external programs like ytdl completely different and might solve the issues without needing an updated ytdl. Please be aware that this is a rather experimental release - should you have any issues with it, please let me know.

Also beware that you might need to revert any changes to your system you already did to fix the issue yourself (like the proposed workarounds).
Works like a charm :) Thx alot
No Bugs found yet
 
Top