Youtube subscriptions

From WikiDLXTV
Revision as of 09:33, 2 January 2011 by Mad ady (Talk | contribs) (A few minor tweaks)

Jump to: navigation, search

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.


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 720P quality by default. Valid values are:
    • 270P
    • 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'
  • 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


Security

  • Currently (version 0.4.5.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