gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

HOWTO: Web video with omxplayerGUI and Chromium-Browser

Mon Oct 17, 2016 9:28 am

For more than 3 years kweb(3) has the built-in possibility to play web video (youtube and 600+ other websites) in high resolution and perfect quality using omxplayer(GUI). Just click the "Play" button in the toolbar on a video web page.

Recently kusti8 has published an extension for the Chromium-Browser that offers the same functionality. It also uses the kweb package (omxplayerGUI and youtube-dl-server). Unfortunately this doesn't work any more with the recent RPF chromium-browser version.

I have built a similar solution for Firefox, which can also be used for chromium-browser now (although it is less elegant than kusti8's solution).

Installation

1) You need the kweb package, if you don't have it installed already: viewtopic.php?t=40860
During installation you will be asked, if you want to install the github version of youtube-dl. It's important to answer with "y". If you missed that, you can install it later from kweb's application page.

Simple method:
(based on a solution for Firefox suggested by MartinLaclaustra):

In chromium right click into the bookmarks toolbar and select "Add Page". In the form set name to "PlayVideo" and paste the following into the URL field:

Code: Select all

javascript:(function(){var target_url=window.location.href;var ytsvr="http://localhost:9192/play?url=";var final=ytsvr.concat(encodeURIComponent(target_url));var myWindow=window.open(final,'_top')})();
Select "Bookmarks Toolbar" below and click "Save". You now should have a new button "PlayVideo".

That's all. You can skip steps 2) and 3) below.

Userscript method:

2) Start chromium-browser and select "Settings" from the menu. Select "Extensions". At the bottom there is a link "Download more extensions" (or similar, I'm on a German system). Click it. A new tab will open with the chrome web store. Search for "Tapermonkey" and install it. Restart chromium-browser afterwards.

3) Go to extensions again, find the tapermonkey extension and click on "Options". On Tapermonkeys menu bar click the icon on the left (it's the only one, the other menu items are displayed as text). The script editor will open with the "New Script" heading. Remove the default content and paste the following into the editor:

Code: Select all

// ==UserScript==
// @name        omxVideo
// @namespace   http://steinerdatenbank.de
// @description Play web video with omxplayerGUI
// @include     *
// @version     1
// @grant       GM_registerMenuCommand
// @grant       GM_getValue
// @grant       GM_setValue
// ==/UserScript==

GM_registerMenuCommand( "Play Video", playvideo, "p");
GM_registerMenuCommand("Video Button on/off",togglebutton);

if (GM_getValue('playbutton',false) === true) {
var input=document.createElement("input");
input.type="button";
input.value="Play";
input.onclick = playvideo;
input.setAttribute("style", "font-size:10px;position:absolute;top:100px;right:20px;");
  document.body.appendChild(input); }

function playvideo() {
  var newuri = "http://localhost:9192/play?url=" + window.location.href;
  window.top.location.href = newuri;
}

function togglebutton() {
if (GM_getValue('playbutton',false) === false) {
GM_setValue('playbutton',true) ; }
else {
GM_setValue('playbutton',false); }
}
Click the "Save" icon (second from the left). If you now browse to any web page, the tapermonkey icon will display the content shown in the attached image.
chromiumytdl.jpg
chromiumytdl.jpg (30.42 KiB) Viewed 15303 times
It contains two new commands: "Play Video" and "Video Button on/off". In order to use them, the youtube-dl-server of the kweb package must be running (see below).

4) This step is optional, but it is the easiest way to use Chromium-Browser with the new feature.
Open a terminal to create a script:

Code: Select all

cd Desktop
nano chromium-omx
Enter the following into it (you can use right click and "Paste"):
#!/bin/bash
ytdl_server.py > /dev/null 2>&1 &
chromium-browser
wget -O /dev/null http://localhost:9192/stop
Press CTRL+o to save it and CTRL+x to leave the editor.
We have to make the script executable:

Code: Select all

chmod +x  chromium-omx
This script will start the youtube-dl-server (running in the background), then chromium-browser and will stop the youtube-dl-server again, if you quit chromium.

Usage

Note: In order to use the extension, the youtube-dl-server must be running. There are different ways to do this:
1) Use the script created in step 4 above to start chromium-browser together with the server. This will also stop the server cleanly when you close the browser.
2) If you have started chromium-browser from the application menu, you can start the server separately in two ways:
Open a terminal and enter:
ytdl_server.py
( Clicking "Start Server" frome kweb's applications page will do the same)

Alternatively you can also start the omxplayerGUI frontend from the application menu. This will also start the server (and stop it, if you close omxplayerGUI frontend).

Now go to a video page on youtube (or any other supported website). If you are using the simple method, click "PlayVideo" in the bookmarks toolbar. If you are using the userscript method, select "Play Video" from the Tapermonkey menu. After a few seconds (2-3 on a RPi 3, but it may take a little bit longer for the first video) omxplayerGUI will be opened and start playing the video. The video in the web page will stop playing, because now it shows a very simple web page from the youtube-dl-server with a message "Playing: " followed by the title of the video and a "Go Back" button below. Click this button to return to the original video web page after you have finished watching the video.

The second user script command "Video Button on/off" gives you a faster way to start playing a video. If you click it and reload the page, a small "Play" button will appear on the top right side of (almost) every web page. Clicking this "Play" button will start the video player in the same way as using the menu command. To disable the button again, select the user script command "Video Button on/off" again (it's a toggle command).

Note: On some websites (vimeo.com, for example) the "Play" button may not be visible, because it is hidden by something else. In this case you have to use the menu command.

Note 2: The "Play" button will also appear within frames or iframes contained in a page. This may be irritating, but also has one advantage: if a web page uses an embedded video, the "Play" button inside the embedding frame can be used to start playing the video. A good example are the embedded videos in the Raspberry Pi Blog. Clicking the "Play" button on top of the page will not start any video, but clicking the "Play" button inside the video frame will work.

Stopping the youtube-dl server
If you have started chromium-browser with the script created in step 4 above, you don't have to do anything. If you have started it manually you can simply close the terminal window. Or you can stop it from inisde chromium-browser:
go to "http://localhost:9192/stop" (add this as a bookmark!).

Using and Configuring omxplayerGUI
If you are new to omxplayerGUI you should start the frontend and click the "Help" button. This will open the omxplayerGUI manual in your preferred PDF viewer. It will give you all the information you need about using and configuring omxplayerGUI. There are really a lot of fine tuning options.

Updating youtube-dl
You should update youtube-dl from time to time. Do not use the "youtube-dl -U" command! You can do it in two ways:
1) Start a terminal and run
update-ytdl
(no sudo!)
2) Start kweb, click on "Applications". At the bottom ("Youtube-dl Tools") click the button "Update (git)".

Note: If kusti8's extension will be working again, you should prefer it. It starts and stops the youtube-dl-server automatically for you.
Last edited by gkreidl on Sun Jan 08, 2017 11:16 pm, edited 2 times in total.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
Trixster
Posts: 262
Joined: Sat Jul 07, 2012 3:53 pm

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Mon Oct 17, 2016 4:06 pm

Works a treat! Thanks.

ultraduck
Posts: 3
Joined: Fri Jun 16, 2017 3:26 pm

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sat Jul 08, 2017 5:02 am

I'm currently running the latest Raspbian on Berryboot. For some odd reason, after installing kweb, I cannot login at all. It just gets stuck. Help please?

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sat Jul 08, 2017 5:37 am

ultraduck wrote:I'm currently running the latest Raspbian on Berryboot. For some odd reason, after installing kweb, I cannot login at all. It just gets stuck. Help please?
Nothing to do with kweb. The installation script will install gdebi-core first (debian package installer from files) and then gdebi is used to install dependencies and kweb itself, which just installes a number of files in /usr/bin, /usr/local/bin and /usr/local/share/kweb.
Perhaps a corrupted or damaged SD card? This can happen at any time.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

ultraduck
Posts: 3
Joined: Fri Jun 16, 2017 3:26 pm

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sat Jul 08, 2017 5:58 am

gkreidl wrote:
ultraduck wrote:I'm currently running the latest Raspbian on Berryboot. For some odd reason, after installing kweb, I cannot login at all. It just gets stuck. Help please?
Nothing to do with kweb. The installation script will install gdebi-core first (debian package installer from files) and then gdebi is used to install dependencies and kweb itself, which just installes a number of files in /usr/bin, /usr/local/bin and /usr/local/share/kweb.
Perhaps a corrupted or damaged SD card? This can happen at any time.
Yeah I did read the installation script and found this behaviour to be quite strange myself. I have also tried this several times with the "Clone" option in Berryboot just to make sure. Even on a vanilla Raspbian installation, as soon as I install kweb and reboot, it just gets stuck. At first, I was only seeing a black screen. And then I used raspi-config to require login. Now it boots up fine to the login screen. But once I enter the password and try to login, it just gets stuck again.
Also, when I login using ctrl+alt+f2 and do reboot, it gets stuck again for 3 minutes while waiting for some process to end. And then just before it shuts down, I see something like "Failed to stop Watchdog ...."

Anyway, I'll try to install this on another SD card with and without Berryboot and see what happens.

stevendom1987
Posts: 1
Joined: Sun May 13, 2018 12:57 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sun May 13, 2018 12:59 am

What about a regular flash video not though YouTube? Also, omx player doesn't truly do full screen. You still get the bars at the top and there isn't a full screen option.

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sun May 13, 2018 3:56 pm

stevendom1987 wrote:
Sun May 13, 2018 12:59 am
What about a regular flash video not though YouTube? Also, omx player doesn't truly do full screen. You still get the bars at the top and there isn't a full screen option.
Flash or not is not important, it depends on the support of the website by youtube-dl (many hundreds of websites are supported).
And omxplayerGUI can be switched to full screen mode (also as default, if you like). There are two keyboard toggle commands, ALT+h (hide the controls) and ALT+f (full screen).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Fri Jul 24, 2020 11:48 am

I am trying to view a video for which there are credentials required. Can someone please tell me where in the below syntax to add --username and --password

javascript:(function(){var target_url=window.location.href;var ytsvr="http://localhost:9192/play?url=";var final=ytsvr.concat(encodeURIComponent(target_url));var myWindow=window.open(final,'_top')})();

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Fri Jul 24, 2020 6:48 pm

Hohnermode11 wrote:
Fri Jul 24, 2020 11:48 am
I am trying to view a video for which there are credentials required. Can someone please tell me where in the below syntax to add --username and --password

javascript:(function(){var target_url=window.location.href;var ytsvr="http://localhost:9192/play?url=";var final=ytsvr.concat(encodeURIComponent(target_url));var myWindow=window.open(final,'_top')})();
You can create a special kweb setting with additional youtube-dl options (including credentials) and save it as a preset. The ytdl-server can be started with this preset:
ytdl_server.py -t=presetname
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Fri Jul 24, 2020 7:06 pm

gkreidl wrote:
Fri Jul 24, 2020 6:48 pm
Hohnermode11 wrote:
Fri Jul 24, 2020 11:48 am
I am trying to view a video for which there are credentials required. Can someone please tell me where in the below syntax to add --username and --password

javascript:(function(){var target_url=window.location.href;var ytsvr="http://localhost:9192/play?url=";var final=ytsvr.concat(encodeURIComponent(target_url));var myWindow=window.open(final,'_top')})();
You can create a special kweb setting with additional youtube-dl options (including credentials) and save it as a preset. The ytdl-server can be started with this preset:
ytdl_server.py -t=presetname
Thank you. I saved --username USERNAME and --password PASSWORD in the preset (Additional youtube-dl options) in seperate lines but the same error keeps popping saying "This video is available for registered users only, use --username and --password or -netrc". After I typed the options, i pressed the save button near the options and then scrolled down, entered a preset name and saved it as well. I then went to the terminal and wrote the command ytdl_server.py -t=userpass. Am I doing something wrong?

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Fri Jul 24, 2020 8:36 pm

Hohnermode11 wrote:
Fri Jul 24, 2020 7:06 pm

Thank you. I saved --username USERNAME and --password PASSWORD in the preset (Additional youtube-dl options) in seperate lines but the same error keeps popping saying "This video is available for registered users only, use --username and --password or -netrc". After I typed the options, i pressed the save button near the options and then scrolled down, entered a preset name and saved it as well. I then went to the terminal and wrote the command ytdl_server.py -t=userpass. Am I doing something wrong?
it should be
--username
USERNAME
etc.
Each word on a new line.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sat Jul 25, 2020 3:11 am

gkreidl wrote:
Fri Jul 24, 2020 8:36 pm
Hohnermode11 wrote:
Fri Jul 24, 2020 7:06 pm

Thank you. I saved --username USERNAME and --password PASSWORD in the preset (Additional youtube-dl options) in seperate lines but the same error keeps popping saying "This video is available for registered users only, use --username and --password or -netrc". After I typed the options, i pressed the save button near the options and then scrolled down, entered a preset name and saved it as well. I then went to the terminal and wrote the command ytdl_server.py -t=userpass. Am I doing something wrong?
it should be
--username
USERNAME
etc.
Each word on a new line.
Yes I tried that as well to no avail. Thank you anyway

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sat Jul 25, 2020 6:56 am

Hohnermode11 wrote:
Sat Jul 25, 2020 3:11 am


Yes I tried that as well to no avail. Thank you anyway
For testing I would use youtube-dl directly:
youtube-dl -g ....further options...... weburi
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sun Jul 26, 2020 6:16 am

gkreidl wrote:
Sat Jul 25, 2020 6:56 am
Hohnermode11 wrote:
Sat Jul 25, 2020 3:11 am


Yes I tried that as well to no avail. Thank you anyway
For testing I would use youtube-dl directly:
youtube-dl -g ....further options...... weburi
Thank you for the response. On attempting the above suggested code I got the following error.

Unable to download JSON metadata: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

The site is UFCArabia. I checked the list of supported sites, it is there

On the command prompt I used
youtube-dl -g -username USERNAME -password PASSWORD http://app.ufcarabia.com/.......

After checking online, they said you have to update your youtube-dl package using youtube-dl -U which I tried. It said "looks like you used a package to install this, use the same to update". So I went to the K-web->applications and tried updating multiple times. It said you are up to date at 2020.6.16.1

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sun Jul 26, 2020 10:27 am

Hohnermode11 wrote:
Sun Jul 26, 2020 6:16 am


Thank you for the response. On attempting the above suggested code I got the following error.

Unable to download JSON metadata: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

The site is UFCArabia. I checked the list of supported sites, it is there

On the command prompt I used
youtube-dl -g -username USERNAME -password PASSWORD http://app.ufcarabia.com/.......

After checking online, they said you have to update your youtube-dl package using youtube-dl -U which I tried. It said "looks like you used a package to install this, use the same to update". So I went to the K-web->applications and tried updating multiple times. It said you are up to date at 2020.6.16.1
Yes, that's the official latest version. I also checked it on the download site.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sun Jul 26, 2020 11:43 am

gkreidl wrote:
Sun Jul 26, 2020 10:27 am
Hohnermode11 wrote:
Sun Jul 26, 2020 6:16 am


Thank you for the response. On attempting the above suggested code I got the following error.

Unable to download JSON metadata: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

The site is UFCArabia. I checked the list of supported sites, it is there

On the command prompt I used
youtube-dl -g -username USERNAME -password PASSWORD http://app.ufcarabia.com/.......

After checking online, they said you have to update your youtube-dl package using youtube-dl -U which I tried. It said "looks like you used a package to install this, use the same to update". So I went to the K-web->applications and tried updating multiple times. It said you are up to date at 2020.6.16.1
Yes, that's the official latest version. I also checked it on the download site.
Any ideas on what else I can try?

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sun Jul 26, 2020 2:31 pm

Hohnermode11 wrote:
Sun Jul 26, 2020 11:43 am

Any ideas on what else I can try?
You could install from source, but there have been only a very few commits since the latest stable version.

You could check the issues at
https://github.com/ytdl-org/youtube-dl/issues

If your problem is not covered by any issue, open a new one.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sun Jul 26, 2020 5:53 pm

gkreidl wrote:
Sun Jul 26, 2020 2:31 pm
Hohnermode11 wrote:
Sun Jul 26, 2020 11:43 am

Any ideas on what else I can try?
You could install from source, but there have been only a very few commits since the latest stable version.

You could check the issues at
https://github.com/ytdl-org/youtube-dl/issues

If your problem is not covered by any issue, open a new one.
Thanks. I got the download working. The above error was thrown due to incorrect password. I got the video to start downloading. But I do not want the download. I want to watch it on OMXplayer or VLC. How can I do that from the command prompt? Also how to get the preset to load on Kweb? (youtube additional options).

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Sun Jul 26, 2020 7:17 pm

Hohnermode11 wrote:
Sun Jul 26, 2020 5:53 pm

Thanks. I got the download working. The above error was thrown due to incorrect password. I got the video to start downloading. But I do not want the download. I want to watch it on OMXplayer or VLC. How can I do that from the command prompt? Also how to get the preset to load on Kweb? (youtube additional options).
Maybe it also needs username and password from the video player. This is not possible with omxplayer(GUI). Try the following first.

youtube-dl -f best -g -username USERNAME -password PASSWORD weburi
This should give you a stream address.
Now try:
vlc streamaddress

Does VLC play the stream?
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Mon Jul 27, 2020 7:09 pm

gkreidl wrote:
Sun Jul 26, 2020 7:17 pm
Hohnermode11 wrote:
Sun Jul 26, 2020 5:53 pm

Thanks. I got the download working. The above error was thrown due to incorrect password. I got the video to start downloading. But I do not want the download. I want to watch it on OMXplayer or VLC. How can I do that from the command prompt? Also how to get the preset to load on Kweb? (youtube additional options).
Maybe it also needs username and password from the video player. This is not possible with omxplayer(GUI). Try the following first.

youtube-dl -f best -g -username USERNAME -password PASSWORD weburi
This should give you a stream address.
Now try:
vlc streamaddress

Does VLC play the stream?
It says HTTP 403 error. On the command prompt the warning is libEGL error:Failed to authenticate
I then tried opening it from the vlc media stream directly, then by ending the url with usr=<username>&pwd=<password> then by starting the url with https://<username>:<password>@url... .It did not work. How do I authenticate? VLC calls it an MRL. I also tried entering the username and password in the rtl rtsp section of demuxers. Any other way?

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Tue Aug 18, 2020 12:46 pm

Do you know if the stream address generated includes headers? I checked a forum concerning credentials on a vlc player. The last post said the address should have headers

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Tue Aug 18, 2020 3:45 pm

Hohnermode11 wrote:
Tue Aug 18, 2020 12:46 pm
Do you know if the stream address generated includes headers? I checked a forum concerning credentials on a vlc player. The last post said the address should have headers
I'm not sure what you mean.

The stream address is cretaed by youtube-dl. You can easily check it by running:

youtube-dl -f best -g URI
(URI = ULR of the web page which contains the video).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Mon Oct 19, 2020 7:02 pm

Hello I am sorry for the late reply. So basically I used the command

youtube-dl -g --username <username> --password <password> 'WEBURI" to get the URI (I assume it now contains the username and password)

then I tried

omxplayer 'address' which resulted in 'Have a nice day'

I tried

vlc 'address' and got the error HTTP 403:forbidden.

Is there anything else to try?

Using your above "Play" button from the browser with the yt-dlserver.py is when I have gotten the closest to running it. Isnt there a way to add username and password to the address in the address bar after localhost:9192...?

The below link talks about request headers. How to get that information?

reddit.com/r/youtubedl/comments/bfgsxx/having_trouble_trying_present_credientials_to/

gkreidl
Posts: 6355
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Tue Oct 20, 2020 7:39 am

Hohnermode11 wrote:
Mon Oct 19, 2020 7:02 pm
Hello I am sorry for the late reply. So basically I used the command

youtube-dl -g --username <username> --password <password> 'WEBURI" to get the URI (I assume it now contains the username and password)

then I tried

omxplayer 'address' which resulted in 'Have a nice day'

I tried

vlc 'address' and got the error HTTP 403:forbidden.

Is there anything else to try?

Using your above "Play" button from the browser with the yt-dlserver.py is when I have gotten the closest to running it. Isnt there a way to add username and password to the address in the address bar after localhost:9192...?

The below link talks about request headers. How to get that information?

reddit.com/r/youtubedl/comments/bfgsxx/having_trouble_trying_present_credientials_to/
This won't work because always two programs are involved (youtube-dl and the player). The following script might work:

Code: Select all

#!/bin/sh
mkfifo /home/pi/pipe.mp4
youtube-dl -f mp4/best -q -u username -p password -o /home/pi/pipe.mp4 "$@" &
sleep 4
omxplayergui /home/pi/pipe.mp4
rm /home/pi/pipe.mp4
I've saved it as playyt.sh and made it executable. From a terminal run

./playyt.sh WEBURI

I have only tested it without username and password.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hohnermode11
Posts: 11
Joined: Fri Jul 24, 2020 11:46 am

Re: HOWTO: Web video with omxplayerGUI and Chromium-Browser

Tue Oct 20, 2020 8:13 pm

I've saved it as playyt.sh and made it executable. From a terminal run

./playyt.sh WEBURI

I have only tested it without username and password.
I tried it. The player starts with no video but with the GUI
The following is the error received emphasis on HEADER

./playyt.sh https://dve-streams.akamaized.net/ns-00 ... e3bcf4b642

WARNING: Could not send HEAD request to https://dve-streams.akamaized.net/ns-00 ... e3bcf4b642: HTTP Error 403: Forbidden

ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 1074, in run
File "/usr/lib/python2.7/threading.py", line 585, in set
File "/usr/lib/python2.7/threading.py", line 407, in notifyAll
<type 'exceptions.TypeError'>: 'NoneType' object is not callable

Please note I updated my youtube-dl to the lastest version prior to trying this.

Return to “Raspberry Pi OS”