Commits

Anonymous committed 9ceefe9

show video description if available in user feed

Comments (0)

Files changed (3)

podcaster/lib/podcast.py

 from podcaster.lib.renderers import RssRenderer, ItunesRenderer
 
 
-VideoFeed = collections.namedtuple('VideoFeed', 'id,guid,title,published,updated,duration')
+VideoFeed = collections.namedtuple('VideoFeed', 'id,guid,title,description,published,updated,duration')
 UserFeed = collections.namedtuple('UserFeed', 'username,title,videos')
 VideoDetails = collections.namedtuple('VideoDetails', 'id,urls')
 VideoFormat = collections.namedtuple('VideoFormat', 'id,description,extension,content_type,supported')
                                      length=10,
                                      type=format.content_type)
                     r << i.duration(v.duration)
+                    r << i.subtitle(v.description)
     raise HTTPOk(body=r.root.write_xmlstring(xml_declaration=True, encoding='utf-8', pretty_print=True),
                  content_type='text/xml')
 

podcaster/platforms/dailymotion/comp.py

     def get_user_feed(self, username, max_results=25):
         ress = restkit.Resource("https://api.dailymotion.com")
         try:
-            resp = ress.get("/videos", user=username, fields='id,title,created_time,modified_time,duration').body_string()
+            resp = ress.get("/videos", user=username, fields='id,title,created_time,modified_time,duration,description').body_string()
         except restkit.errors.RequestFailed:
             # Not found
             return None
         data = json.loads(resp)
 
         videos = []
+        feed_title = "Uploads by %s" % username
         for v in data['list']:
             id = v['id']
             title = v['title']
             published = datetime.fromtimestamp(float(v['created_time']))
             updated = datetime.fromtimestamp(float(v['modified_time']))
             duration = int(v['duration'])
-            videos.append(VideoFeed(id, guid, title, published, updated, duration))
+            description = v['description']
+            videos.append(VideoFeed(id, guid, title, description, published, updated, duration))
 
-        return UserFeed(username, username, videos)
+        return UserFeed(username, feed_title, videos)
 
     def get_video_details(self, id):
         ress = restkit.Resource("https://api.dailymotion.com")

podcaster/platforms/youtube/comp.py

             title = vtag.find('{%s}title' % ns).text
             id = vtag.find('{%s}group/{%s}videoid' % (nsmedia, nsyt)).text
             duration = int(vtag.find('{%s}group/{%s}duration' % (nsmedia, nsyt)).get('seconds'))
-            videos.append(VideoFeed(id, guid, title, published, updated, duration))
+            description = ''
+            videos.append(VideoFeed(id, guid, title, description, published, updated, duration))
         return UserFeed(username.lower(), feed_title, videos)
 
     def get_video_details(self, id):