YePpHa / YouTubeCenter

YouTube Center is a userscript designed to expand the functionality of YouTube. It includes the ability to download the video you're watching, auto selecting your preferred video quality and much more.
MIT License
2.89k stars 520 forks source link

Download in 320MP3 non-functional, some typos. #2146

Open DrKittens opened 8 years ago

DrKittens commented 8 years ago

Under the download menu using the youtubeinmp3.com link doesnt work as they've changed/removed their API/php posting method.

Audio download is incorrectly spelt, its shown as 129 instead of 128.

And probably outside of your control but with some videos attempting to download them with this plugin it results in a blank page instead of a download link. Heres a link a friend and i managed to replicate this issue with: https://www.youtube.com/watch?v=w8jvnJhBww0

Attempted to download in webm standard definition.

CollinChaffin commented 7 years ago

I can also confirm that the MP3 download functions specific to youtubeinmp3.com need to be updated. They did change the API/post and I have spent some time to help out Jeppe and get the fix worked out (haven't had time to throw together the code).

To lay out what has changed - the new/updated API post process and specific to the OPs YT example link, the new process is to perform a GET but now to form the request to youtubeinmp3.com first in this fashion:

In the userscript, add for example a new element (make it an iFrame marquerated as a hidden/appearing button), and make that iFrame src in this format:

src = "https://www.youtubeinmp3.com/widget/button/?color=DA2623&video={ INSERT FULL SELF LOCATION YT VIDEO'S URL }"

So, to test this new format, using the above example video, simply paste (or click) this URL in our new format directly into the browser. You should be presented with a single page (would be our new iFrame/button) now completely RED (but confirms if put in a nice iFrame makes a nice red button), that is even nicely titled with this video's info, and a target link direct to the MP3 to download:

https://www.youtubeinmp3.com/widget/button/?color=DA2623&video=https://www.youtube.com/watch?v=w8jvnJhBww0

Obviously the color code can be changed, but I felt using the actual youtube red code fitting. :)

Then, that video-specific link that was previously generated the old way, is obviously now the target of our new iFrame(Button) of the following (the actual direct MP3 binary link):

https://www.youtubeinmp3.com/download/get/?i=Wg%2FYYECq%2Fzz46rGGkOafB9fCQpaLl7AM4plmeWjboBIH2JRyGzArE3EdBuoZ3PJ2N%2BfEGpyHTRnTPi9P93xCnw%3D%3D&progressType=button&color=DA2623

So, hope this helps being single dad of 2 babies time is a bit of a commodity right now but this weekend if I have time I may try to throw together the code to reflect the above required fix. Jeppe, I assume a normal pull would be preferred?