Comments (8)
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.
I'm sad too
Any fix for that?
Thanks,
Original comment by tht2401
on 29 Oct 2014 at 2:13
from youtube-api-samples.
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.
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.
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.
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.
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.
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)
- Upload a video to youtube - python api error
- ResumableUploadError HOT 1
- Patch for /samples/java/youtube-cmdline-liststreams-sample/src/main/java/com/google/api/services/samples/youtube/cmdline/youtube_cmdline_liststreams_sample/ListStreams.java
- The Request was aborted: The request was canceled (dotnet upload) HOT 2
- compilation of youtube-cmdline-uploadvideo-sample fails
- Patch for /samples/javascript/search.html
- Provide web version of ASP.Net Samples
- Patch for yt_analytics_report.py
- Patch for /samples/dotnet/upload_video.cs
- "youtubeSignupRequired : Unauthorized" error if the user doesn't have channel HOT 1
- Clicking on red play button on embedded video doesnt start the video on Ios devices
- Patch for /samples/java/youtube-cmdline-uploadvideo-sample/src/main/java/com/google/api/services/samples/youtube/cmdline/youtube_cmdline_uploadvideo_sample/UploadVideo.java
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from youtube-api-samples.