Difference between revisions of "Youtube subscriptions"

From WikiDLXTV
Jump to: navigation, search
(Added shortcut link)
Line 68: Line 68:
 
==Developer/Changelog==
 
==Developer/Changelog==
 
* This plugin was developed by Dan
 
* This plugin was developed by Dan
* mad_ady adapted it to use youtube authentication + some debugging. Also, added support for navigation inside the clips (FF/Rew)
+
* mad_ady adapted it to use youtube authentication + some debugging (+ playlists, search, sorting, album art). Also, added support for navigation inside the clips (FF/Rew)
 
* Discussion thread http://forum.wdlxtv.com/viewtopic.php?f=49&t=713&start=0
 
* Discussion thread http://forum.wdlxtv.com/viewtopic.php?f=49&t=713&start=0

Revision as of 01:08, 2 May 2011

Description

The Youtube subscriptions plugin allows you to view your Youtube subscription videos the same way the youtube interface shows them to the registered users. The plugin is included in the base usmp plugins. The plugin has two components: proxy+web interface and a helper script that generates a list of new videos from your subscriptions. The helper script can be run periodically to ensure you can access the latest videos.

Later, support for playlists has been added and they work similar to subscriptions.

You can also use the search button to search through the cache file for videos with a specific title. The search is done case insensitive and it is interpreted as a regular expression (characters like +, *, ., [], etc have special meaning).


Prerequisites

  • Your Youtube username and password must be entered in the WDTV Youtube section and saved. You can check this by looking for your credentials in /conf/account_list.xml


Configuration

  • Enable Youtube Subscriptions from the web interface (using WEC), or by adding a suitable entry to your /conf/umsp.php
  • To periodically update for new subscriptions(e.g. every 10 minutes), add this entry to your crontab (crontab -e from ssh/telnet):
*/10   *   *   *   *   /usr/bin/php5-cgi /tmp/umsp-plugins/youtube-subscriptions/youtube-subscriptions-helper.php --insecure  >/tmp/youtube-subscriptions-helper.txt 2>&1

See http://en.wikipedia.org/wiki/Cron for cron syntax

  • After the update, you should get videos under UMSP->Youtube Subscriptions->Your account
  • If you have YOUTUBE_QUALITY set in your configuration, the videos will have the requested resolution (if available) automatically. If it's not set, you will get 240P quality by default. Valid values are:
    • 240P
    • 360P
    • 480P
    • 720P
    • 1080P
  • If you want more than 30 videos per channel listed, add this to your configuration (or configure it from the web interface):
config_tool -c YOUTUBE_VIDEOS_PER_CHANNEL='50'
  • If you want more than 300 videos in New Subscription Videos, add this to your configuration (or configure it from the web interface):
config_tool -c YOUTUBE_NEW_VIDEOS='500'
  • Subscription videos are sorted by default newest first. You can change this by using YOUTUBE_SUBSCRIPTION_SORT (or configure it from the web interface):
config_tool -c YOUTUBE_SUBSCRIPTION_SORT='random'
  • Playlist videos are not sorted by default. You can change this by using YOUTUBE_PLAYLIST_SORT (or configure it from the web interface):
config_tool -c YOUTUBE_PLAYLIST_SORT='random'
  • If you make changes to your configuration, make sure to save it before rebooting (it is saved automatically on reboot, but can be lost if there is a power outage)
config_tool -s
  • If you want your subscriptions to be updated first thing when your wdtv starts up, add this to your /conf/S99user-script
#!/bin/sh
# update youtube subscriptions - delay with 30s!
(sleep 30; /usr/bin/php5-cgi /tmp/umsp-plugins/youtube-subscriptions/youtube-subscriptions-helper.php --insecure > /tmp/youtube-subscriptions.txt 2>&1)&


Troubleshooting

  • If you don't see your channels in the UMSP GUI, do the following checks:
    • run /usr/bin/php5-cgi /tmp/umsp-plugins/youtube-subscriptions/youtube-subscriptions-helper.php --insecure by hand in the command line. Look for error messages and their descriptions
    • check that the file /tmp/youtube-subscriptions.cache exists and has content inside (ids and names of youtube clips)
    • check that cron is running and that your crontab is working fine
# 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 
  • if cron runs properly you should see messages like this in /tmp/messages.txt:
Jan  1 05:22:01 Deneb cron.err crond[10624]: USER root pid 18851 cmd /usr/bin/php5-cgi /tmp/umsp-plugins/youtube-subscriptions/youtube-subscriptions-helper.php --insecure  >/tmp/youtube-subscriptions-helper.txt 2>&1
  • If you need to enable logging, you can change each script and edit the line with $logLevel appropriately:
// set the logging level, one of L_ALL, L_DEBUG, L_INFO, L_WARNING, L_ERROR, L_OFF
global $logLevel;
$logLevel = L_WARNING;

Logging goes to /tmp/umsp-log.txt

Shortcuts

If you want to add shortcut entries under UMSP to take you directly to a specific playlist or subscription, you can add custom entries to /conf/umsp.php folowing the examples here: http://forum.wdlxtv.com/viewtopic.php?f=49&t=713&p=33936#p33645 (you just send in the correct parameters in the "id" string)

Security

  • Currently (version 0.4.5.3/0.4.7.3) there is a problem with the certificates that the built-in package curl has shipped in and it can't verify if the server you are talking to is actually the Youtube authentication server. This check is disabled by using --insecure parameter when running youtube-subscriptions-helper.php. When curl will come with the correct certificates, you can drop --insecure and it will verify the authenticity of the Youtube server. Keep in mind that the authentication process is still encrypted regardless of --insecure.


Developer/Changelog