youtube / api-samples

Code samples for YouTube APIs, including the YouTube Data API, YouTube Analytics API, and YouTube Live Streaming API. The repo contains language-specific directories that contain the samples.
5.49k stars 2.97k forks source link

api-samples / python / upload_video.py - bug in resumable_upload #6

Open CarlFK opened 10 years ago

CarlFK commented 10 years ago

I first posted here https://code.google.com/p/youtube-api-samples/issues/detail?id=11 This is the same problem, better report.

The bug is in the sample code, not the API.

The important lines
https://github.com/youtube/api-samples/blob/master/python/upload_video.py#L131-L135

def resumable_upload(insert_request): while response is None: status, response = insert_request.next_chunk() if 'id' in response:

while response is None - response will be None when there are more chunks to upload (fine)

if 'id' in response - this will error when response is None. (bug)

jack17529 commented 7 years ago

Any active member in Youtube ?