youtube python api gdata.service. requesterror -


I have the following code that is trying to add a set of video to a YouTube playlist

< Pre> import urlib, import again gdata.youtube import gdata.youtube.service class reddit (): def __init __ (auto, rssurl = 'http: //www.reddit.com/r/chillmusic.rss' ): Self. URL = rssurl self._downloadrs () def _downloadrss (self): If self.URL.endswith ('.sys'): # Download RRS feed subreddit - Try saving as "feed.rss": print "From RSS Download Reddit ... "urllib.urlretrieve (URL," feed.rss ") Except exceptions: print eDF clean (self): playlist = open (" feed.rss "). Read () links = re.findall ('http: //www.youtube.com \ S +)' for link in the link, playlist): firstpass = link.replace ('& amp; quot; and & gt; [Link] & amp; lt; / a & gt; ',' ') secondpass = firstpace ('& Amp;; Amp; amp; FMT = 18', '') Thresep = secondspace.rele ('& amp; convenience = related', '') last page = third parse.releast ('http: // Www.youtube.com / clock? V = ',' ') print thresacpass, "\ t extracted:", last page back, last palette class google (): def __init __ (auto, username, password): self.Username = Username self.password = password #do Do not change any of the following. Key = "Aaistisdiadijijiaacji Y -8 An_ajjiajbiouaisadi 2-B2-Araaiaijijioakebiardisi 2 Fafafaiojiaoake 5 Kekseedi 2 Fafafaiocugiakskyudi 2 Fghfbk 8 Oak GU 7 Sisiffelelu 7 N 7 Walk GU 7 Sisiffelelu 7 N 7 YK 0 GG 7 Elartikyudi 7 CAG 72 New Zealand Spi. .Username self.service.password = self.password self.service.developer_key = self.keyself.service.client_id = self.appname self.service.source = self.appname self.service.ssl = false self.service.programmaticlogin Y_playlist.entry: p = [] k = [p.link [1]) y_playlist = self.service.GetYouTubePlaylistFeed (username = 'default') l = [] k = [] .href, p.title.text ] L.append (k) Returns l def get_playlist_id_from_url (self, href): #chick and dirty method to get the return href of playlist id. ('Http://www.youtube.com / view_play_list P =', '') def creat_playlist (self, name = "reddit list", disk = "video from reddit") :? playlistentry = self.service.AddPlaylist (name, disk) if isinstance (playlistentry, GData. youtube.YouTubePlaylistEntry): print "New Playlist pair of back playlistentry.link [1] .href def add_video_to_playlist (self, Playlist_uri, video): video_entry = Self.service.AddPlaylistVideoEntryToPlaylist (playlist_uri, video) ifinstance (video_entry, gdata.youtube .YouTubePlaylistVideoEntry): Print 'Video Added' URL = "http://www.reddit.com/r/chillmusic.rss" r = reddit (URL) g = google ( 'xx@gmail.com', 'xxxx') g.authenticate () def Search_playlist (playlist = "Reddit list 3"): pl_id = g.get_playlists pl none (in): If pl [1] == Playlists: pl_id =: pl_id = pl [0] print if pl_id No break == pl_id g.creat_playlist (name = playlist) return pl_id please = search_playlist () (in r.clean to video_id): g.add_video_to_playlist (please, video_id)

when I run the code I am to receive the following error message gdata.service.RequestError: { 'status': 303, 'body': '', 'reason': 'other View'} Any one knows why I am getting this error

Cheers Nash


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -