Coder Social home page Coder Social logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
The sample code uses a chunksize of -1 (all at once):

https://code.google.com/p/youtube-api-samples/source/browse/samples/python/uploa
d_video.py#104

  media_body=MediaFileUpload(options.file, chunksize=-1, resumable=True)

so it never chunks, thus it never runs the chunking code, which is where this 
bug lives.

Original comment by [email protected] on 6 May 2014 at 9:47

from youtube-api-samples.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I'm sad too
Any fix for that?

Thanks,

Original comment by tht2401 on 29 Oct 2014 at 2:13

from youtube-api-samples.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Nope.

The same code (and bug) is also here:
https://github.com/youtube/api-samples/blob/master/python/upload_video.py#L131-L
135

I stared to work on a fix, but testing error handling is hard, so I just gave 
up and set chunksize=-1.

https://github.com/CarlFK/veyepar/blob/master/dj/scripts/youtube_v3_uploader.py#
L181

Original comment by [email protected] on 29 Oct 2014 at 3:15

from youtube-api-samples.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I added a simple line of code, it worked beautifully (check None for response):

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

Original comment by tht2401 on 29 Oct 2014 at 4:20

from youtube-api-samples.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I think you moved the bug to this:

if error is not None:
print error
retry += 1
if retry > MAX_RETRIES:
exit("No longer attempting to retry.")

You don't set error, so it is still None, so retry will never get incremented, 
so it may loop forever.  

Which may be better than erroring, but still not right.  
I was hoping that by now someone would have fixed the code but I guess it isn't 
a priority. 

Original comment by [email protected] on 29 Oct 2014 at 4:29

from youtube-api-samples.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I haven't looked at api code but I think that response will be None until the 
last chunk is sent.
error is not None only when we have an exception from 
insert_request.next_chunk()
The sample code has MAX_RETRIES so it won't loop forever.

Original comment by tht2401 on 29 Oct 2014 at 4:39

from youtube-api-samples.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
ah right, I see what you are saying. 

pretty please submit a pull request over on 
https://github.com/youtube/api-samples (you can do it by editing the code right 
there, click the edit link that takes you to
https://github.com/youtube/api-samples/edit/master/python/upload_video.py

Original comment by [email protected] on 29 Oct 2014 at 4:46

from youtube-api-samples.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
https://github.com/youtube/api-samples/pull/18

Original comment by tht2401 on 29 Oct 2014 at 4:58

from youtube-api-samples.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.