Author Topic: Urgent - local server now needed for Trailers and VideoSearchXL youtube support  (Read 1556 times)

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 394
  • Helpful Contribution Status: +203/-55
As discussed in other posts, the last fix to  trailers result in the trailer server.....mede8er.click....making ALL the requests for youtube data on behalf of users. Youtube have now blocked mede8er.click from access for overuse.
We need to spread the load back to users.   

Mede8er.click will make a request of this type:-

http://xxx.xxx.xxx.xxx:8080/trailers/ytapi.php?vid=7TavVZMewpY

Mede8er.click detects the clients current Internet IP to  fill in the xxx.xxx.xxx.xxx.

You need to port foward internet requests on port 8080 to  a locally hosted http  server via its port number..most likely 80.

I have created a VitualBox Linux Build to act as that  server. It needs the latest 6.1 version of Oracle Virtualbox.

The build is in the form of a Vbox export...an ova file.

https://drive.google.com/open?id=1N5NPIZjnmWpKoU_XY_XChHPxD0198O1s

Once downloaded, use the Vbox Import function to install it.

Its settings will need changing to use your lan connection in the Network Bridge. 

VideosearchXL now works in the same way for youtube. Vimeo has not yet been blocked for excessive use.

if you already have a linux based http server on your LAN, there are two files which  can be unzipped into  its html document root. The server must support Python and PHP.

http://www.mede8er.click/trailers.zip

http://www.mede8er.click/youtube.zip

These have the linux version of youtube-dl in each folder. You must change its Permissons so its opended as an executable.

I could build windows version of these folders, but I cannot test them. If someone wants to test them please say.     

« Last Edit: December 20, 2019, 10:13:19 AM by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 394
  • Helpful Contribution Status: +203/-55
I have ordered a pi 3 A+ kit for £30. I plan to  see if it can  do  the job.  Some people pay more than that  for a HDMI cable.
It will  be running Pihole.  Pihole themsleves offer a prebuilt Pi 3 B for £90. Thats overkill  for an ad filtering DNS server.   
Installing Pihole does most of the hard work. It needs a simple http server with PHP support. All i have done is put a couple of folders in its HTML document root.
« Last Edit: December 21, 2019, 12:10:39 PM by jer1956 »

Offline kazza61

  • Newbie
  • Posts: 46
  • Helpful Contribution Status: +1/-0
You clearly have a knowledge and technical skill that goes way beyond most Mede8er users Jer1956! I donít really understand any of those two posts but did just want to say that I really appreciate your efforts to try and get our Mede8ers fully functioning again! Best wishes.

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 394
  • Helpful Contribution Status: +203/-55
The problem was youtube-dl overloaded youtube.com, and .click  was blocked by youtube. Whilst developing this alternative i came across a youtube shadow site which  youtube-dl could use instead. 
Changing to  that stopped the overloading, and is still working.

I am still improving the local server approach....just in case. 

...and it keeps the little grey cells active!

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 394
  • Helpful Contribution Status: +203/-55
I have now changed this  fall back solution to use this:-

 https://youtube-dl-api-server.readthedocs.io/en/latest/

I have it  hosted on a PI 3A+.

The test code on mede8er.click creates a HTML5 video block using PHP where the video source is like this:-


http://xxx.xxx.xxx.xxx:9191/api/play?url=https://www.youtube.com/watch?v=7TavVZMewpY

Where xxx.xxx.xxx.xxx is the clients WAN IP. That link indirectly finds the source 720p MP4 url via the api server on the PI.

It takes about 4 seconds off the start of each video as youtube-dl is loaded when the PI 3A+ boots, not each times it used.

Here is a test link:-
http://www.mede8er.click/fixed_ytapi.html?vid=7TavVZMewpY

But I have other things i wish to set up on the PI, so it may stop working.
« Last Edit: January 07, 2020, 10:46:55 AM by jer1956 »

Offline Kez

  • Newbie
  • Posts: 6
  • Helpful Contribution Status: +0/-0
Hi jer1956

Thanks for this.  Is that test link still up and running?  I've set my port-forwarding so 9191 goes to my web server with the appropriate files from your first post, but nothing happens except that is displays the mede8er movie trailer graphic.

Running nginx, PHP 7.3, and Python 3.

Cheers
Kez

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 394
  • Helpful Contribution Status: +203/-55
I stopped running the test some time ago when  we got the main server working again. Though I have not tested that myself for some time.

This tests the main server:-

http://www.mede8er.click/ytapi.html?vid=7TavVZMewpY