Automate Video Upload To YouTube With Python (And YouTube API)
Вставка
- Опубліковано 18 чер 2024
- So upload a video with UA-cam API is probably not as straightforward as people would think. And with recent UA-cam API changes, I thought I would make an updated video on how to upload a video to UA-cam with UA-cam API using Python.
► Buy Me a Coffee? Your support is much appreciated!
-------------------------------------------------------------------------------------------
☕ Paypal: www.paypal.me/jiejenn/5
☕ Venmo: @Jie-Jenn
💸 Join Robinhood with my link and we'll both get a free stock: bit.ly/3iWr7LC
▶ Related Videos:
📼 Add Videos To UA-cam Playlist With Python: • Add Videos To UA-cam ...
📼 Manage UA-cam Playlists With Python: • Manage Your UA-cam Pl...
📼 Manage UA-cam Subscriptions With Python: Manage UA-cam Subscription With Python
📼 Scrape Channel Videos Detail With Python: • Python Project: Create...
▶ Resources:
📑 Source Code: wp.me/payCAw-1jY
📑 google_apis.py Source Code: wp.me/payCAw-Vp
📼 Getting Started With Google APIs For Python Development: • Getting Started With G...
📕 Video.Insert() Method Reference: developers.google.com/youtube...
📕 Video Object Representation: developers.google.com/youtube...
🧾 UA-cam Channel Audit Form: support.google.com/youtube/co...
► Support my channel so I can continue making free contents
---------------------------------------------------------------------------------------------------------------
🛒 By shopping on Amazon → amzn.to/2JkGeMD
👩💻 Follow me on Linked: / jiejenn
🌳 Becoming a Patreon supporter: / jiejenn
✉️ Business Inquiring: UA-cam@LearnDataAnalysis.org
🕢 Timestamps:
-------------------------------
00:00 - Intro & Notes & Agenda
02:33 - Libraries Import
04:18 - Step 1. Upload Video
11:24 - Step 2. Update Video Thumbnail
12:14 - Step 3. Update Video Privacy Status
#python #automation #youtube #youtubeapi
to fix the schedule issue:
1. change "publishedAt" to "publishAt" (status in private)
2. time format must be in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format, example: upload_time = "2023-02-12T23:59:59Z"
I just tried, and it worked.
Thanks! Just pinned your comment so everyone can see.
No, "publishAt" doesn't work. It needs to be "publishedAt". But the time format is good :) Thanks!
Very good, It works.
'status': {
'privacyStatus': 'private', #public, private
'publishAt': upload_date_time,
'selfDeclaredMadeForKids': False,
},
if privayStatus is public, don't need publishAt parameter.
What does Z in the date/time format mean?
This video makes so much more sense than the official youtube data api documentation. Thank you so much
simple. effective. very good tutorial
The login window appears more times? It has a daily timeout or it's a one time deal and the server can upload for days without manual clicks? Thanks!
Thank you so much!!
I would like to know if it is possible to post image and text on community post with similar approach like this?
I don't believe community API is available publicly.
Thank you sir, I've been searching around and testing all kinds of snippet, either from google's API sample, codes in the document, chatGPT, StackOverflow, all of them are failing. Some of the code might just be stale, some of code just not working. Eventually I get to the point that I need a redirect address, but localhost:8080 just don't work. After quite frustrating trial and error, I was about to give up till seeing yours. How do you get this right? I was really baffling how to find the correct samples from official docs. Many thanks!!
How would I upload a video if I'm not running this on a windows machine? I have a Linode Linux box that I use..I can't get a browser window to open to authenticate on the command line..how do I proceed?
There is also a 10,000 units Quota limit for using UA-cam API daily.
Thank you for your video, very clear and explanatory. Is there a way to share a private video using email addresses with the UA-cam API?
Not that I am aware of. Your best bet is to check the officially doc.
@@jiejenn yes... already checked and i don't found anything 😕 thanks for your answer
If you want to share just the video link of your own videos, you can construct the video url first then send an email with the link in it using Gmail API.
Sorry if you explained in your video and I missed it. You're obviously uploading to a 2ndary channel you have, "Channel Content", how did you do that?. I want to upload to one of my secondary channels too. How do you pick the channel for the video to upload to. THANKS!!!
Hi Max, you select the account that tied to a UA-cam channel when you go through the authentication. If you wish to select a different account, simply delete the tokens folder if you are already authenticated.
@@jiejenn Got it.. THANKS! For anyone reading it is the 2nd screen (first is for your email), second will be the "account" or channel, and that information is stored to "credentials.storage" I believe. It doesn't overwrite "client_secret.json" Jie you know more than I ;)
I tried both PublishAt as you have specified in Pinned comment and PublishedAt with correct ISO time. It does not work. Can you please help? It just publish it as Private.
I have implemented everything so the whole works well but leide I get after 5 video uploads already a HTTP ERRO 400 "uploadLimitExceeded" the next day I can upload again for videos, that's too little I teilweiße per DAY 50 shorts and more ? Do you have any idea what I can do to increase the limit ?
how to fix
from google_apis import Create_Service
ModuleNotFoundError: No module named 'google_apis'
Thanks for this but I get this error:
'response_video_upload = service.videos().insert(
AttributeError: 'NoneType' object has no attribute 'videos'.'
Any idea why?
Probably there is nothing for the service to upload. Could be the video isnt where you think it is. check the path. Chatgpt is great for debugging.
Where do you specify the UA-cam Channel to which you're uploading the video please?
Can you be more specific?
Suppose I can upload 6 video per day through youtube api. If I have two chanels on the same account. Can I upload 6 videos per day on each chanel.
@jie, I am not able to resolve this error. Please help
from google_apis import create_service
ModuleNotFoundError: No module named 'google_apis'
Check the description for google_apis source code.
@@jiejenn Thanks. Can we somehow automate the process of authentication, as that's the only break in automating posts on youtube?
Unless I missed it, I don't see you creating the authentication config in Google. I am running into an issue now that Google has discontinued the Out of Band authentication. I get an Error 400: invalid_request and it indicates the Loopback IP Address flow has been discontinued.
Not familiar with this error. You might need to Google it.
I have the same issue as i am running on aws cloud9 and the OOB authentication method has been discontinued. Did you managed to find a work around?
@@Talemuse-Cyoa I unfortunately have not.
@@jeffrey.edgett Thanks for the response. Will share if i find a workaround
i got error this:with open(client_secrets_file, "r") as json_file:
FileNotFoundError: [Errno 2] No such file or directory: 'client-secret.json'
Why are you trying to open the file? And the error description clearly states the issue.
@@jiejenn Your code uses that file, and I didn't see where you went over making it.
I covered that at 03:09
wow, 👍🏼 Have you found why the video schedule was not working.
Seems like it's a bug with the API.
This videos cannot be public right?
Why not?
UA-cam doesn’t allow it. Public uploads via OAuth is only allowed for verified apps(projects)
So the only way to make it public is:
1) submit the Google app for verification
2) create the project with a Google workspace account and make it internal
Yes,I met the same issue
Nobody ever mentions this, surprisingly