Index: channels/youtube.py
==================================================================
--- channels/youtube.py
+++ channels/youtube.py
@@ -61,10 +61,11 @@
# description
title = "Youtube"
module = "youtube"
homepage = "http://www.youtube.com/"
listformat = "url/youtube"
+ has_search = True
fmt = "video/youtube"
titles = dict( genre="Channel", title="Title", playing="Playlist", bitrate=False, listeners=False )
# API config
service = {
@@ -85,11 +86,11 @@
]
}
categories = [
"mostPopular",
- ["Music", "Comedy", "Movies", "Shows", "Short Movies", "Trailers", "Film & Animation", "Entertainment", "News & Politics"],
+ ["Music", "Comedy", "Movies", "Shows", "Trailers", "Film & Animation", "Entertainment", "News & Politics"],
"topics",
["Pop", "Billboard charts", "Rock", "Hip Hop", "Classical", "Soundtrack", "Ambient",
"Jazz", "Blues", "Soul", "Country", "Disco", "Dance", "House", "Trance", "Techno", "Electronica"],
"my channels",
["Key of Awesome", "Pentatonix"]
@@ -175,17 +176,22 @@
i = self.categories.index("my channels") + 1
self.categories[i] = [ title.strip() for title in conf.youtube_channels.split(",") ]
# retrieve and parse
- def update_streams(self, cat, force=0, search=None):
+ def update_streams(self, cat, search=None):
entries = []
channels = self.categories[self.categories.index("my channels") + 1]
+ # plain search request for videos
+ if search is not None:
+ for row in self.api("search", type="video", regionCode=conf.youtube_region, q=search):
+ entries.append( self.wrap3(row, {"genre": "Youtube"}) )
+
# Most Popular
- if cat == "mostPopular":
+ elif cat == "mostPopular":
#for row in self.api("feeds/api/standardfeeds/%s/most_popular"%conf.youtube_region, ver=2):
# entries.append(self.wrap2(row))
for row in self.api("videos", chart="mostPopular", regionCode=conf.youtube_region):
entries.append( self.wrap3(row, {"genre": "mostPopular"}) )
@@ -215,14 +221,10 @@
entries.append(self.wrap3(row, {"genre": cat, "playing": playlist["snippet"]["title"]}))
self.update_streams_partially_done(entries)
self.parent.status(i / 15.0)
- # plain search request for videos
- elif search is not None:
- for row in self.api("search", type="video", regionCode=conf.youtube_region, q=search):
- entries.append( self.wrap3(row, {"genre": ""}) )
# empty entries
else:
entries = [dict(title="Placeholder for subcategories", genre="./.", playing="./.", url="http://youtube.com/")]
Index: gtk2.xml
==================================================================
--- gtk2.xml
+++ gtk2.xml
@@ -1067,10 +1067,20 @@
+
+
-
- cancel
- togglebutton1
- google_search
- server_search
- cache_search
-
+
+ True
+ False
+ gtk-harddisk
+
+
+ True
+ False
+ gtk-add
+
False
0.95999999999999996
5
station search
@@ -1079,84 +1088,23 @@
True
False
end
-
- cancel
- True
- True
- True
-
-
-
- False
- False
- 0
-
-
-
-
- True
- True
-
-
- False
- False
- 1
-
-
-
-
- google it
- True
- True
- True
- Instead of searching in the station list, just look up the above search term on google.
- half
-
-
-
- False
- False
- 2
-
-
-
-
- query srv
- True
- False
- True
- Instead of doing a cache search, go through the search functions on the directory service homepages. (UNIMPLEMENTED)
- half
-
-
-
- False
- False
- 3
-
-
-
-
- cache _search
- True
- False
- True
- True
- True
- Start searching for above search term in the currently loaded station lists. Doesn't find *new* information, just looks through the known data.
- True
-
-
-
-
- False
- False
- 4
-
+
+
+
+
+
+
+
+
+
+
+
+
+
False
False
@@ -1181,936 +1129,11 @@
True
0
-
- True
- False
- Which channels/directories to look through.
- 4
- 4
- 5
- 1
- True
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- all channels
- True
- True
- False
- 0.5
- True
- True
-
-
-
-
- True
- True
- 1
-
+
True
False
@@ -2161,199 +1184,58 @@
True
2
-
+
+
+
+
+
+
+
True
False
- In which fields to look for the search term.
- 3
- True
+ 20
-
-
+
+ Cache _find
True
- True
+ False
+ True
+ True
True
- none
+ Start searching for above search term in the currently loaded station lists. Doesn't find *new* information, just looks through the known data.
+ image1
+ half
+ True
+
+
- False
- False
+ True
+ True
0
-
- in title
+
+ Server _search
True
- True
- False
- 0.5
- True
- True
+ False
+ True
+ Instead of doing a cache search, go through the search functions on the directory service homepages. (UNIMPLEMENTED)
+ image2
+ True
+
True
True
1
-
-
- in description
- True
- True
- False
- 0.5
- True
- True
-
-
- True
- True
- 2
-
-
-
-
- any fields
- True
- True
- False
- 0.5
- True
-
-
- True
- True
- 3
-
-
-
-
-
- True
- True
- True
- none
-
-
- False
- False
- 4
-
-
-
-
- True
- True
- 3
-
-
-
-
- True
- False
- In which fields to look for the search term.
- 3
- True
-
-
-
- True
- True
- True
- none
-
-
- False
- False
- 0
-
-
-
-
- homepage url
- True
- True
- False
- 0.5
- True
- True
-
-
- True
- True
- 1
-
-
-
-
-
- True
- True
- 2
-
-
-
-
- and genre
- True
- True
- False
- 0.5
- True
-
-
- True
- True
- 3
-
-
-
-
-
- True
- True
- True
- none
-
-
- False
- False
- 4
-
-
-
-
- True
- True
- 4
-
-
-
-
- True
- False
-
-
-
-
-
-
-
-
-
True
True
5
@@ -2366,17 +1248,10 @@
1
-
- cancel
- togglebutton1
- google_search
- server_search
- cache_search
-