6👍
✅
I’ve just deleted youtube video using gdata and ProgrammaticLogin()
Here is some steps to reproduce:
import gdata.youtube.service
yt_service = gdata.youtube.service.YouTubeService()
yt_service.developer_key = 'developer_key'
yt_service.email = 'email'
yt_service.password = 'password'
yt_service.ProgrammaticLogin()
# video_id should looks like 'iu6Gq-tUsTc'
uri = 'https://gdata.youtube.com/feeds/api/users/%s/uploads/%s' % (username, video_id)
entry = yt_service.GetYouTubeUserEntry(uri=uri)
response = yt_service.DeleteVideoEntry(entry)
print response # True
yt_service.GetYouTubeVideoFeed(uri)
works because GetYouTubeVideoFeed
doesn’t check uri and just calls self.Get(uri, ...)
but originaly, I think, it expected 'https://gdata.youtube.com/feeds/api/videos'
uri.
vice versa yt_service.GetYouTubeVideoEntry()
use YOUTUBE_VIDEO_URI = 'https://gdata.youtube.com/feeds/api/videos'
but this entry doesn’t contains rel="edit"
Hope that helps you out
1👍
You can view the HTTP headers of the generated requests by setting the debug flag to true. This is as simple as:
yt_service = gdata.youtube.service.YouTubeService()
yt_service.debug = True
Source:stackexchange.com