Sign up here and you can log into the forum!

Plugin: YouTube Subscriptions + new subscription videos

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby mad_ady » Wed Nov 17, 2010 1:07 am

Hello biomedica,

You can increase the number of videos requested by editing these variables in the helper script (look in the beginning):

Code: Select all
$videoCountPerChannel=20; //change this if you want to see more than x new clips per channel
$maxTotalVideos=150; //change this if you want to keep more than x results for each account


I haven't played with them very much, so they could be wrong (meaning they don't do what they say). Change a value to fit your needs and re-run the helper script. You should get more videos in your cache file.
I'm planning on changing the way these values are used - instead of hardcoding them here I plan on parsing specific configuration variables instead...

But first, try to set them by hand and report back if they work for you.

I haven't tried yet to run the script from cron - I've just ran it at startup (since I usually reboot the wdtv often). I will look into running it from cron. There shouldn't be any problems, but there might... :)
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby b-rad.cc » Wed Nov 17, 2010 9:43 am

mad_ady wrote:I've managed to allow for a selectable video resolution. If you have the YOUTUBE_QUALITY=480P configuration variable set, then the plugin will download a lower quality video for you. Unfortunately I couldn't find the correct mapping, but I'm using this:

Code: Select all
//decide what video quality to request
   /*
   22: 720p, HD, ~3-5Mbps
   18: 360p, good quality, stereo sound, ~1Mbps
   6:  360p, good quality, mono sound, ~1Mbps
   0:  360p, lowest quality -- or original resolution?
   */
//set a default quality setting -> HD by default
  $fmt = 22; 



this is from /usr/share/webend/youtube-proxy/youtubeHD.php:
Code: Select all
$quality_map = array('1080P' => 37, '720P' => 22, '480P' => 35, '360P' => 34, '270P' => 18);
PM's are for private matters only, please post public matters on the forum to help others who might have the same issue.
:mrgreen:
User avatar
b-rad.cc
WDLXTV Team
 
Posts: 3002
Joined: Sat Apr 03, 2010 9:35 am
Location: New York

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby mad_ady » Wed Nov 17, 2010 11:06 am

Thank you b-rad :roll: I knew they must be defined elsewhere, but I was too lazy to look for them
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby mad_ady » Wed Nov 17, 2010 11:31 am

biomedica:

I am performing performed some cron-related tests. Please check the following:
1. cron is working:
Code: Select all
# config_tool -c CROND='ON'
config saved val:key => (CROND,ON)
# /etc/init.d/S90crond start   
# ps | grep cron
10624 root      3648 S    crond
10721 root      3712 S    grep cron

2. you have a correct crontab entry (for instance, this entry updates the cache every 10 minutes):
Code: Select all
# crontab -l
*/10   *   *   *   *   /usr/bin/php5-cgi /conf/youtube-subscriptions-helper.php --insecure >/tmp/youtube-subscriptions-helper.txt 2>&1


If it runs, you should get output and errors in /tmp/youtube-subscriptions-helper.txt. If the file exists and is not blank (and your subscriptions are not updated), please post it to the thread.

If your cron runs properly, you should get a log similar to this in /tmp/messages.txt:
Code: Select all
Jan  1 05:22:01 Deneb cron.err crond[10624]: USER root pid 18851 cmd /usr/bin/php5-cgi /conf/youtube-subscriptions-helper.php --insecure  >/tmp/youtube-subscriptions-helper.txt 2>&1
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby mad_ady » Wed Nov 17, 2010 11:54 am

b-rad.cc wrote:
this is from /usr/share/webend/youtube-proxy/youtubeHD.php:
Code: Select all
$quality_map = array('1080P' => 37, '720P' => 22, '480P' => 35, '360P' => 34, '270P' => 18);


I've made the change in my proxy, but I'm seeing something strange... When I have YOUTUBE_QUALITY='720P' the video resolution is 1280x723. If YOUTUBE_QUALITY='480P', the resolution is 480x240. The quality, though looks good (worthy of 480P), so I'm guessing the wdtv player must be estimating the resolutions incorrectly... If I change YOUTUBE_QUALITY and reload a video, it will continue to show the old resolution (although based on bandwidth utilization it isn't streaming that resolution).

Is this a known issue of the wdtv player, or is some metadata mixed up somewhere?
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby mad_ady » Fri Nov 19, 2010 8:25 am

I've submitted the changes to the svn (revision 36). You should get the updated scripts next time you reboot (your UMSP server).
Check out what customizations can be done on the wiki page: http://wiki.wdlxtv.com/Youtube_subscriptions

If you have problems, please post them in this thread. If you can't get videos, please post the output from the helper script to figure out what's wrong.

Enjoy
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby topsykretts » Mon Nov 22, 2010 8:38 am

Where exactly do I enter my username and password
I downloaded via ftp these files from here:( /tmp/umsp-plugins/youtube-subscriptions )

config.php
subscriptions-helper.php
youtube-subscriptions-proxy.php
youtube-subscriptions.php
youtube-subscriptions_wec.php
topsykretts
n00b
 
Posts: 12
Joined: Fri Apr 23, 2010 3:32 pm

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby mad_ady » Mon Nov 22, 2010 10:38 pm

You should enter your username and password in the OSD under Videos -> Youtube -> Account -> Sign In. Choose to save both username and password. Check to see if you can see regular youtube videos first while logged in.

You shouldn't need to download any more files. Your UMSP server should be synchronized with the latest revision from the svn. You just need to run the youtube-subscriptions-helper.php script to populate the cache file. Then you should see your videos under Videos -> Media Servers -> UMSP -> My Youtube Subscriptions (if you've added it in UMSP configuration). Check out the wiki page for details on how to do it.
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby topsykretts » Tue Nov 23, 2010 3:57 am

I'm not a big fan of linux:)
Could you explain to me step by step how to "run the youtube-subscriptions-helper.php script to populate the cache file."

On the first page I found this:

How to use the plugin:

First) to activate crond Adding in / boot/S00custom-options
config_tool crond-c = ON

Second) run "crontab-e 'via SSH and add:
* / 4 * / usr/bin/php5-cgi / tmp / umsp-plugins / youtube-subscriptions / youtube-subscriptions-helper.php

How do I copy it (* / 4 * / usr/bin/php5-cgi / tmp / umsp-plugins / youtube-subscriptions / youtube-subscriptions-helper.php) and then paste the entire text to the crontab and at the end save him.
Can I make it through telnet?
(Thank you and sorry for bad english)
topsykretts
n00b
 
Posts: 12
Joined: Fri Apr 23, 2010 3:32 pm

Re: Plugin: YouTube Subscriptions + new subscription videos   

Postby mad_ady » Tue Nov 23, 2010 7:36 am

Well, Linux is your friend... Give it time and you might be a fan of it ;)
Unfortunately the details in the front post are no longer accurate. Use this wiki page instead: http://wiki.wdlxtv.com/Youtube_subscriptions

Here's what you need to do
  • Telnet to your wdtv
  • Run the following command:
  • Code: Select all
    /usr/bin/php5-cgi /tmp/umsp-plugins/youtube-subscriptions/youtube-subscriptions-helper.php --insecure

  • If you get output saying that it's about to write the cache file, you're fine. If you get some error message, please post it here to better understand the problem

Next, add the command to your crontab (so that the cache is updated periodically) by doing these steps:
    Code: Select all
    crontab -e

  • In the editor that has opened (it's called nano), type in the following line (make sure it's all on one line):
  • Code: Select all
    */10   *   *   *   *   /usr/bin/php5-cgi /tmp/umsp-plugins/youtube-subscriptions/youtube-subscriptions-helper.php --insecure  >/tmp/youtube-subscriptions-helper.txt 2>&1

  • Save and exit by typing CTRL+O, ENTER and CTRL+X


Now, enable cron by doing:
Code: Select all
config_tool -c CROND='ON'
config_tool -s
/etc/init.d/S90crond start 


Now, your subscriptions should update automatically every 10 minutes. The settings are persistent across reboots.

Good luck!
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

PreviousNext

Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 3 guests