own playlist 4 yahoo youtube widget

Here for general support for B series TVs, request and problem solve area.

User avatar
boxbuchse
Posts: 24
Joined: Sun Jun 10, 2012 1:47 pm

own playlist 4 yahoo youtube widget

Post by boxbuchse » Sun Jun 10, 2012 2:42 pm

Hi,

I've been reading for years since I bought my b650.
It really sucks that I cannot bookmark my own videos
or get my favorites on the YouTube widget.

YOU NEED: telnet access to your TV and/or know how to edit a file on the TV-System

Now I found out that it is quite easy, all you have to do
is add a couple of lines to:

Code: Select all

\mtd_down\widget\data\Widgets\Installed\com.youtube.widgets.tv.widget\Contents\Source\core\application.js
at line 310, the JavaScriptArray "standardFeeds" are the key and we can add some own stuff.

Code: Select all

	var bu = 'http://gdata.youtube.com/feeds/api/standardfeeds/' + cc + '/';
	var cl = 'client=ytapi-samsung-tv';
	var rf = 'alt=json';
	var fr = 'format=3';
	var fl = 'racy=include';	//'racy=exclude'; No Filter!
	var bp = '?' + cl + '&' + rf + '&' + fr + '&' + fl;

	var standardFeeds = [
		{ id: 'featured', label: $_('featured'), value: bu + 'recently_featured' + bp },
		{ id: 'most-viewed', label: $_('most_viewed'), value: bu + 'most_viewed' + bp + '&time=today' },
		{ id: 'most-recent', label: $_('most_recent'), value: bu + 'most_recent' + bp },
		{ id: 'top-rated', label: $_('top_rated'), value: bu + 'top_rated' + bp },
		{ id: 'top-favorites', label: $_('top_favorites'), value: bu + 'top_favorites' + bp },
I added a user "htmlworld" (you can just use your own username)

Code: Select all

		{ id: 'my-favorites0', label: 'HTML', value: 'http://gdata.youtube.com/feeds/api/users/htmlworld/uploads' + bp + '&orderby=published' },
or it is easy to add a YouTube Playlist (for my kids)
you have to know the PlaylistID: (e.g. E45288B6C5F1E0CF)

Code: Select all

		{ id: 'my-favorites1', label: 'Yakari', value: 'http://gdata.youtube.com/feeds/api/playlists/E45288B6C5F1E0CF' + bp },
It is very important that the "id" is different for every line.
"label" is the name for the list in the Widget
and "value" is the URL of the VideoFeed from YouTube API

I love it, now i can add videos on my laptop or my phone to the youtube playlist
and watch it on TV. Hopefully someone can use it too.

TNX
boxbuchse

PS:
my Firmware: T-CHL7DEUC-2005.0
Last edited by boxbuchse on Sun Jun 24, 2012 12:50 pm, edited 1 time in total.
LExxB650 T-CHL7DEUC-2005.0 telnet, ext3 hdd, ArFIX

User avatar
juusso
SamyGO Moderator
Posts: 10100
Joined: Sun Mar 07, 2010 6:20 pm

Re: own playlist 4 yahoo youtube widget

Post by juusso » Sun Jun 10, 2012 2:54 pm

Wow, its impressive. Now we can use own playlists on yahoo widgets too. Thanks!
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE

User avatar
boxbuchse
Posts: 24
Joined: Sun Jun 10, 2012 1:47 pm

Re: own playlist 4 yahoo youtube widget

Post by boxbuchse » Sun Jun 10, 2012 3:03 pm

hey juuso,

yes, i'll check if we can use other than YouTube Feeds too.
LExxB650 T-CHL7DEUC-2005.0 telnet, ext3 hdd, ArFIX

User avatar
juusso
SamyGO Moderator
Posts: 10100
Joined: Sun Mar 07, 2010 6:20 pm

Re: own playlist 4 yahoo youtube widget

Post by juusso » Sun Jun 10, 2012 3:26 pm

I think here is possible to edit/add playlists using SamyGO webif. Could be useful.

Yes, please share your other archievements too, B series is not dead :-)
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE

atulb
Posts: 7
Joined: Thu Nov 17, 2011 6:20 am

Re: own playlist 4 yahoo youtube widget

Post by atulb » Sun Jun 10, 2012 9:45 pm

Doesn't work for me. The new option shows up but it does not load any files.

User avatar
boxbuchse
Posts: 24
Joined: Sun Jun 10, 2012 1:47 pm

Re: own playlist 4 yahoo youtube widget

Post by boxbuchse » Mon Jun 11, 2012 8:03 am

Hi atulb,

sometimes i got errors like this. It is probably because the feed is not well formed. You can try this in a Browser (without "alt=json"):

Code: Select all

http://gdata.youtube.com/feeds/api/users/[youruser]/uploads?client=ytapi-samsung-tv&format=3&racy=include&orderby=published
Usually the "orderby=published" is the key. If you fail you can send me a PN with your URL and i fix it for you.

And every time you made a change you have to restart the Samy or at least the Internet@TV (but i don't know how)
LExxB650 T-CHL7DEUC-2005.0 telnet, ext3 hdd, ArFIX

User avatar
boxbuchse
Posts: 24
Joined: Sun Jun 10, 2012 1:47 pm

Re: own playlist 4 yahoo youtube widget

Post by boxbuchse » Mon Jun 11, 2012 11:23 am

hi,

it should be possible to use any Video-Feed with the namespace "Media RSS" from Yahoo
http://en.wikipedia.org/wiki/Media_RSS

and if I modify the xhr.js it could be any Video-Feed with mp4 links

But is it worth the work?
LExxB650 T-CHL7DEUC-2005.0 telnet, ext3 hdd, ArFIX

atulb
Posts: 7
Joined: Thu Nov 17, 2011 6:20 am

Re: own playlist 4 yahoo youtube widget

Post by atulb » Tue Jun 12, 2012 10:43 pm

^ Can you please explain which lines to edit in xhr file. I would like to test streaming flash url and some other files.

Also i searched everywhere to modify the you-tube API url to play HD files, because currently it plays only default 360/480p. i have tired to add ?hd=1 to the url but no go.

edit: NVM i figured how to modify xhr.js but can you please show how to add non-yahoo rss feeds. I tried one of my own web server and no go

User avatar
boxbuchse
Posts: 24
Joined: Sun Jun 10, 2012 1:47 pm

Re: own playlist 4 yahoo youtube widget on own server

Post by boxbuchse » Wed Jun 13, 2012 10:22 am

Hi atulb,

if it is your own server then it is easy and you don't have to change xhr.js
Just put a file on the server in YouTube format and in JSON (not XML):

http://example.com/my-playlist.json

Code: Select all

{
    "version": "1.0",
    "encoding": "UTF-8",
    "feed": {
        "id": {
            "$t": "http://gdata.youtube.com/feeds/api/users/karaoke/uploads"
        },
        "updated": {
            "$t": "2012-06-13T08:34:22.265Z"
        },
        "title": {
            "$t": "Uploads by karaoke",
            "type": "text"
        },
        "openSearch$totalResults": {
            "$t": 5
        },
        "openSearch$startIndex": {
            "$t": 1
        },
        "openSearch$itemsPerPage": {
            "$t": 5
        },
        "entry": [
            {
                "id": {
                    "$t": "http://gdata.youtube.com/feeds/api/videos/JCnjKb9mDlI"
                },
                "published": {
                    "$t": "2012-03-16T15:59:40.000Z"
                },
                "updated": {
                    "$t": "2012-06-04T17:47:14.000Z"
                },
                "title": {
                    "$t": "Prototype Kaiser Micro Jig/Mini Madai Rod - Miniwee 66",
                    "type": "text"
                },
                "content": {
                    "$t": "Location - Indonesia Boat was anchored in 30ish metres of water. Tackles: Rod - Kaiser Miniwee 66 (Prototype) Reel - Daiwa Exist 2506 Line - 4lbs Jig - 30g",
                    "type": "text"
                },
                "author": [
                    {
                        "name": {
                            "$t": "karaoke"
                        },
                        "uri": {
                            "$t": "http://gdata.youtube.com/feeds/api/users/karaoke"
                        }
                    }
                ],
                "gd$comments": {
                    "gd$feedLink": {
                        "rel": "http://gdata.youtube.com/schemas/2007#comments",
                        "href": "http://gdata.youtube.com/feeds/api/videos/JCnjKb9mDlI/comments?client=ytapi-samsung-tv",
                        "countHint": 1
                    }
                },
                "media$group": {
                    "media$category": [
                        {
                            "$t": "Sports",
                            "label": "Sport",
                            "scheme": "http://gdata.youtube.com/schemas/2007/categories.cat"
                        }
                    ],
                    "media$content": [
                        {
                            "url": "http://www.youtube.com/v/JCnjKb9mDlI?version=3&f=user_uploads&c=ytapi-samsung-tv&app=youtube_gdata",
                            "type": "application/x-shockwave-flash",
                            "medium": "video",
                            "isDefault": "true",
                            "expression": "full",
                            "duration": 570,
                            "yt$format": 5
                        },
                    ],
                    "media$description": {
                        "$t": "Location - Indonesia Boat was anchored in 30ish metres of water. Tackles: Rod - Kaiser Miniwee 66 (Prototype) Reel - Daiwa Exist 2506 Line - 4lbs Jig - 30g",
                        "type": "plain"
                    },
                    "media$keywords": {
                        "$t": "kaiser, pro, shop, fishing, Fishing Rod (Sports Equipment), jigging, micro, jig, miniwee, singapore, malaysia, indonesia"
                    },
                    "media$player": [
                        {
                            "url": "http://www.youtube.com/watch?v=JCnjKb9mDlI&feature=youtube_gdata_player"
                        }
                    ],
                    "media$thumbnail": [
                        {
                            "url": "http://i.ytimg.com/vi/JCnjKb9mDlI/0.jpg",
                            "height": 360,
                            "width": 480,
                            "time": "00:04:45"
                        },
                        {
                            "url": "http://i.ytimg.com/vi/JCnjKb9mDlI/1.jpg",
                            "height": 90,
                            "width": 120,
                            "time": "00:02:22.500"
                        },
                        {
                            "url": "http://i.ytimg.com/vi/JCnjKb9mDlI/2.jpg",
                            "height": 90,
                            "width": 120,
                            "time": "00:04:45"
                        },
                        {
                            "url": "http://i.ytimg.com/vi/JCnjKb9mDlI/3.jpg",
                            "height": 90,
                            "width": 120,
                            "time": "00:07:07.500"
                        }
                    ],
                    "media$title": {
                        "$t": "Prototype Kaiser Micro Jig/Mini Madai Rod - Miniwee 66",
                        "type": "plain"
                    },
                    "yt$duration": {
                        "seconds": "570"
                    }
                },
                "gd$rating": {
                    "average": 5,
                    "max": 5,
                    "min": 1,
                    "numRaters": 3,
                    "rel": "http://schemas.google.com/g/2005#overall"
                },
                "yt$statistics": {
                    "favoriteCount": "0",
                    "viewCount": "1056"
                }
            },
            { ...
            },
            { ...
            },
            { ...
            }
        ]
    }
}
the important entrys are "title","url"
and this is the association:

Code: Select all

			item = {
				id: entries[i].id.$t,
				author: entries[i]['author'][0].name.$t,
				authorUrl: entries[i]['author'][0].uri.$t,
				avatar: null,
				title: entries[i]['media$group']['media$title'].$t,
				url: entries[i]['media$group']['media$content'][0].url,
				thumbnail: entries[i]['media$group']['media$thumbnail'][0],
				preview: entries[i]['media$group']['media$thumbnail'][3],
				description: entries[i]['media$group']['media$description'].$t,
				keywords: ( '$t' in entries[i]['media$group']['media$keywords'] ) ? entries[i]['media$group']['media$keywords'].$t : '',
				categories: entries[i]['media$group']['media$category'][0].$t,
				duration: entries[i]['media$group']['yt$duration'],
				published: entries[i].published.$t,
				updated: entries[i].updated.$t,
				statistics: statistics,
				rating: ratings
			};
you can test your JSON file here:
http://jsonlint.com/

But i did not test it, so good luck and let us know if it works.
LExxB650 T-CHL7DEUC-2005.0 telnet, ext3 hdd, ArFIX

atulb
Posts: 7
Joined: Thu Nov 17, 2011 6:20 am

Re: own playlist 4 yahoo youtube widget

Post by atulb » Tue Jun 26, 2012 11:29 pm

Sorry i forgot to update this, your code only had few syntax errors but it is valid json otherwise. However, the playlist file is not at all loaded.

Going foward, the only reason to built a custom playlist xml/json file is to be able to utilize other embedded flash videos outside of Youtube, otherwise there is not point in developing custom json script for Youtube videos because you can create your own playlist with a Youtube account and simply edit application.js with your own Youtube playlist.

Post Reply

Return to “[B] Support”