Extensions :  K-Meleon Forum
All about K-Meleon extensions. 
Download YouTube Videos as MP4
Posted by: guest
Date: June 28, 2017 12:45PM

Any ideas how to make "Download YouTube Videos as MP4" work?
https://github.com/gantt/downloadyoutube

It's an userjs, works in Firefox, Chrome, Opera, Safari

It has to somehow also work in K-Meleon...

Any tips how? Rodocop, as a pro you should know! smiling smiley

Thanks

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: JohnHell
Date: August 06, 2017 08:58PM

Read the instructions in KMM file for updating script file, folders it uses and file names to adopt.

This release does only need to uncompress to macros Root folder. No renaming needs.


For further details on the script configuration, open the JS file and read it or refer to GitHub page.


Note: the macro reads the JS file each time a YouTube video page loads. I did this because the JS file is configurable, so if you change something you can enjoy it without restarting K-meleon.

The drawback is that it would make a 36KB hard disk read each time a YouTube video loads (example: youtube.com/watch?v=videocode).

Due to that JS file size, the macro is only compatible with 75.0 and above.



Edited 3 time(s). Last edit at 08/06/2017 09:06PM by JohnHell.

Attachments: Download YouTube Videos as MP4.zip (12.2 KB)  
Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: luk3Z
Date: August 11, 2017 07:38AM

It's working like a charm. Good job JohnHell.

Instruction for any new KM users:

Just unpack "Download YouTube Videos as MP4.zip (12.2 KB)" to .\K-Meleon\macros

(KM version : KM 75.0 or newer)

__________________________________________
Best regards.
How to install Firefox addons in KM 76 RC:
http://kmeleonbrowser.org/forum/read.php?9,141979



Edited 1 time(s). Last edit at 08/11/2017 07:39AM by luk3Z.

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: foliator
Date: August 11, 2017 03:26PM

The macro works for me, too. However, while some of the videos download properly, others immediately start playing in the browser's HTML5 player instead of being downloaded, and I can't successfully save them that way. I generally leave HTML5 enabled; would it help if I disabled it for use with this macro? In that case, if the video opened in my offline media player I could save a copy from there.

-----

Using KM 75.0 on Windows 7 (x86)

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: JohnHell
Date: August 11, 2017 03:42PM

Quote
foliator
The macro works for me, too. However, while some of the videos download properly, others immediately start playing in the browser's HTML5 player instead of being downloaded, and I can't successfully save them that way. I generally leave HTML5 enabled; would it help if I disabled it for use with this macro? In that case, if the video opened in my offline media player I could save a copy from there.

I can't answer to that. Or I browse with JavaScript disabled, so doesn't play, or I have webm format support disabled from preferences so YouTube player encounters an error and doesn't play it.

I just made the macro to make use of the script. Beyond that, I don't know what could be the reason the script doesn't work if the video already plays. Haven't tested and, anyway, is beyond this macro functionality.

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: foliator
Date: August 11, 2017 03:59PM

OK, looks like I've answered my own question. :lol: I tried toggling HTML5 off just before clicking on the download link. It worked perfectly. Staying on the same video, I then toggled HTML5 back on and started the download again; as I expected, it opened in the HTML5 player.

Now I'm going to try inserting the HTML5 Disabled statements at the very top of the download macro; maybe it will disable HTML5 automatically prior to the download. Then I can always toggle HTML5 back on later.

-----

Using KM 75.0 on Windows 7 (x86)

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: JohnHell
Date: August 11, 2017 04:11PM

Quote
foliator
Now I'm going to try inserting the HTML5 Disabled statements at the very top of the download macro; maybe it will disable HTML5 automatically prior to the download. Then I can always toggle HTML5 back on later.

Emmmm, no, that won't work. Placing a toggle at the beginning of the macro will do nothing unless you invoke it.

And the macro is just invoked on load (using the macro holder $OnLoad).

That, without further explanations means, that anything is run unless the page has fully loaded, included the HTML5 video player.

Any toggle you do must be done BEFORE you load the YouTube page, and, therefore, the script invoked by this macro.

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: foliator
Date: August 11, 2017 04:52PM

Quote
JohnHell
Quote
foliator
Now I'm going to try inserting the HTML5 Disabled statements at the very top of the download macro; maybe it will disable HTML5 automatically prior to the download. Then I can always toggle HTML5 back on later.

Emmmm, no, that won't work. Placing a toggle at the beginning of the macro will do nothing unless you invoke it.

And the macro is just invoked on load (using the macro holder $OnLoad).

That, without further explanations means, that anything is run unless the page has fully loaded, included the HTML5 video player.

Any toggle you do must be done BEFORE you load the YouTube page, and, therefore, the script invoked by this macro.

True, inserting the toggle doesn't work, as I discovered by trial and error. It's just as easy for me to quickly toggle HTML5 off beforehand using a keyboard shortcut, although I've been able to do so even after the page has fully loaded and the download link appears. So now I just wait until YouTube starts the video playing, pause it, toggle HTML5 off and hit the download link. Pretty easy, actually, and thanks for sharing that macro!

BTW, sometimes the file downloads as "videoplayback" without an extension, but it's easy to add the extension and rename the file later. At other times, the file comes down already properly named with its title and the MP4 extension.

-----

Using KM 75.0 on Windows 7 (x86)

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: JohnHell
Date: August 11, 2017 05:06PM

Quote
foliator
BTW, sometimes the file downloads as "videoplayback" without an extension, but it's easy to add the extension and rename the file later. At other times, the file comes down already properly named with its title and the MP4 extension.

As posted, that is up to the script developer. Remember to check the github page for updates!! ;)


OH GOD I JUST FOUND THE GITHUB PROJECT DOESN'T EXISTS ANYMORE LOL!!!


HERE AS WELL xDDD

https://greasyfork.org/en/scripts/1317-download-youtube-videos-as-mp4



Edited 2 time(s). Last edit at 08/11/2017 05:10PM by JohnHell.

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: siria
Date: August 11, 2017 05:13PM

Or calling the macro only manually, only when needed, not automatically after every page load ($OnLoad). The catch is that would of course require again a shortcut/menu/button, but if you don't mind that it's another possibility. In that case the toggle could be included.

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: JohnHell
Date: August 11, 2017 05:18PM

Quote
siria
Or calling the macro only manually, only when needed, not automatically after every page load ($OnLoad). The catch is that would of course require again a shortcut/menu/button, but if you don't mind that it's another possibility. In that case the toggle could be included.

I leave enhancements and changes to any of you ;)

It is open to anyone who wants to make changes smiling smiley

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: foliator
Date: August 11, 2017 05:38PM

Quote
JohnHell
OH GOD I JUST FOUND THE GITHUB PROJECT DOESN'T EXISTS ANYMORE LOL!!!

HERE AS WELL xDDD

https://greasyfork.org/en/scripts/1317-download-youtube-videos-as-mp4

Ha! Maybe Google forced the project off those sites in an attempt to prevent video downloads!

Anyway, it looks like you got that script just in time.

This is why I always store applications that I've stopped using in Zip archives. I might later decide to start using them again, but they may no longer be available online. "Get it while it's hot," as they say. grinning smiley

-----

Using KM 75.0 on Windows 7 (x86)

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: foliator
Date: August 11, 2017 05:40PM

Quote
JohnHell
Quote
siria
Or calling the macro only manually, only when needed, not automatically after every page load ($OnLoad). The catch is that would of course require again a shortcut/menu/button, but if you don't mind that it's another possibility. In that case the toggle could be included.

I leave enhancements and changes to any of you ;)

It is open to anyone who wants to make changes smiling smiley

... and has the knowledge and/or patience to do so. smiling smiley

-----

Using KM 75.0 on Windows 7 (x86)

Options: ReplyQuote
Re: Download YouTube Videos as MP4
Posted by: foliator
Date: August 11, 2017 05:42PM

Quote
siria
Or calling the macro only manually, only when needed, not automatically after every page load ($OnLoad). The catch is that would of course require again a shortcut/menu/button, but if you don't mind that it's another possibility. In that case the toggle could be included.

Hmmm ... I might try that later. It might also be necessary for the macro to force a reload of the YouTube page if it hasn't been invoked before loading the page.

UPDATE: No, the page doesn't need to be reloaded. I commented out the $OnLoad statement in the original macro with #. Then I wrote a brand-new macro called YTdownload, which looks like this:

YTdownload{
setpref(BOOL, "media.autoplay.enabled", false);
setpref(BOOL, "media.fragmented-mp4.enabled", false);
setpref(BOOL, "media.ogg.enabled", false);
setpref(BOOL, "media.wave.enabled", false);
setpref(BOOL, "media.webm.enabled", false);
setpref(BOOL, "media.windows-media-foundation.enabled", false);
setpref(BOOL, "media.windows-media-foundation.play-stand-alone", false);
setpref(BOOL, "media.windows-media-foundation.use-dxva", false);
$_x=getpref(BOOL,"media.fragmented-mp4.enabled");
statusbar("HTML5 enabled: ".$_x);
macros(downloadyoutubescript_checkYT);
}

It first disables HTML5, then invokes the download macro. It only requires a single shortcut (I assigned ALT Y). It's not really more convenient, because in my original approach, where the script was allowed to be invoked automatically ($OnLoad), only a single shortcut was required for toggling HTML5. In fact, my second approach would leave HTML5 disabled after the download, so I'd still have to toggle it back on later.

-----

Using KM 75.0 on Windows 7 (x86)



Edited 2 time(s). Last edit at 08/11/2017 07:49PM by foliator.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.