Пример #1
0
 def on_mainwindow_favoriteVideo(self):
     body = """<?xml version="1.0" encoding="UTF-8"?>
             <entry xmlns="http://www.w3.org/2005/Atom">
               <id>%s</id>
             </entry>""" % self._yt_id
     req = Request("https://gdata.youtube.com/feeds/api/users/default/favorites",
                   util.vlcstring(body))
     req.add_header("Content-Type", "application/atom+xml")
     req.add_header("Content-Length", len(body))
     req.add_header("GData-Version", "2")
     req.add_header("X-GData-Key", auth.GDATA_KEY)
     auth.yauth.urlopen(req)
Пример #2
0
 def on_mainwindow_likeVideo(self):
     body = """<?xml version="1.0" encoding="UTF-8"?>
                 <entry xmlns="http://www.w3.org/2005/Atom"
                        xmlns:yt="http://gdata.youtube.com/schemas/2007">
                   <yt:rating value="like"/>
                 </entry>"""
     req = Request("https://gdata.youtube.com/feeds/api/videos/%s/ratings" % self._yt_id,
                   util.vlcstring(body))
     req.add_header("Content-Type", "application/atom+xml")
     req.add_header("Content-Length", len(body))
     req.add_header("GData-Version", "2")
     req.add_header("X-GData-Key", auth.GDATA_KEY)
     auth.yauth.urlopen(req)