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

КОМЕНТАРІ • 48

  • @Anime_823
    @Anime_823 Рік тому +8

    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.

    • @jiejenn
      @jiejenn  Рік тому +1

      Thanks! Just pinned your comment so everyone can see.

    • @liujanis636
      @liujanis636 11 місяців тому

      No, "publishAt" doesn't work. It needs to be "publishedAt". But the time format is good :) Thanks!

    • @vdictionary82
      @vdictionary82 11 місяців тому

      Very good, It works.
      'status': {
      'privacyStatus': 'private', #public, private
      'publishAt': upload_date_time,
      'selfDeclaredMadeForKids': False,
      },
      if privayStatus is public, don't need publishAt parameter.

    • @jeevanmarg
      @jeevanmarg 3 місяці тому

      What does Z in the date/time format mean?

  • @ensl0
    @ensl0 9 місяців тому +1

    This video makes so much more sense than the official youtube data api documentation. Thank you so much

  • @swimingly2994
    @swimingly2994 Рік тому

    simple. effective. very good tutorial

  • @andrevasko
    @andrevasko Рік тому

    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!

  • @hongkongintheworld
    @hongkongintheworld Рік тому

    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?

    • @jiejenn
      @jiejenn  Рік тому

      I don't believe community API is available publicly.

  • @orbuluh_jp_notes
    @orbuluh_jp_notes Рік тому

    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!!

  • @RoyalRadande
    @RoyalRadande 11 місяців тому

    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?

  • @jeevanmarg
    @jeevanmarg 3 місяці тому

    There is also a 10,000 units Quota limit for using UA-cam API daily.

  • @albertoliva7954
    @albertoliva7954 6 місяців тому

    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?

    • @jiejenn
      @jiejenn  6 місяців тому +1

      Not that I am aware of. Your best bet is to check the officially doc.

    • @albertoliva7954
      @albertoliva7954 6 місяців тому

      @@jiejenn yes... already checked and i don't found anything 😕 thanks for your answer

    • @jiejenn
      @jiejenn  6 місяців тому

      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.

  • @maxcanthelpit
    @maxcanthelpit Рік тому +1

    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!!!

    • @jiejenn
      @jiejenn  Рік тому +2

      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.

    • @maxcanthelpit
      @maxcanthelpit Рік тому +1

      @@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 ;)

  • @jeevanmarg
    @jeevanmarg 3 місяці тому

    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.

  • @upload-dev
    @upload-dev 9 місяців тому

    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 ?

  • @duynghiavo7915
    @duynghiavo7915 5 місяців тому

    how to fix
    from google_apis import Create_Service

    ModuleNotFoundError: No module named 'google_apis'

  • @WonderRob
    @WonderRob Рік тому

    Thanks for this but I get this error:
    'response_video_upload = service.videos().insert(
    AttributeError: 'NoneType' object has no attribute 'videos'.'
    Any idea why?

    • @Talemuse-Cyoa
      @Talemuse-Cyoa Рік тому

      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.

  • @words-of-wisdom-on-youtube
    @words-of-wisdom-on-youtube Рік тому

    Where do you specify the UA-cam Channel to which you're uploading the video please?

    • @jiejenn
      @jiejenn  Рік тому

      Can you be more specific?

  • @Find-Odd-Emoji
    @Find-Odd-Emoji 7 місяців тому

    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.

  • @manikantasurapathi92
    @manikantasurapathi92 10 місяців тому

    @jie, I am not able to resolve this error. Please help
    from google_apis import create_service
    ModuleNotFoundError: No module named 'google_apis'

    • @jiejenn
      @jiejenn  10 місяців тому

      Check the description for google_apis source code.

    • @manikantasurapathi92
      @manikantasurapathi92 10 місяців тому +1

      @@jiejenn Thanks. Can we somehow automate the process of authentication, as that's the only break in automating posts on youtube?

  • @jeffrey.edgett
    @jeffrey.edgett Рік тому

    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.

    • @jiejenn
      @jiejenn  Рік тому

      Not familiar with this error. You might need to Google it.

    • @Talemuse-Cyoa
      @Talemuse-Cyoa Рік тому

      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?

    • @jeffrey.edgett
      @jeffrey.edgett Рік тому

      @@Talemuse-Cyoa I unfortunately have not.

    • @Talemuse-Cyoa
      @Talemuse-Cyoa Рік тому

      @@jeffrey.edgett Thanks for the response. Will share if i find a workaround

  • @Tory269
    @Tory269 Рік тому

    i got error this:with open(client_secrets_file, "r") as json_file:
    FileNotFoundError: [Errno 2] No such file or directory: 'client-secret.json'

    • @jiejenn
      @jiejenn  Рік тому

      Why are you trying to open the file? And the error description clearly states the issue.

    • @GoodByeWorld895
      @GoodByeWorld895 Рік тому

      @@jiejenn Your code uses that file, and I didn't see where you went over making it.

    • @jiejenn
      @jiejenn  Рік тому

      I covered that at 03:09

  • @dannotes9396
    @dannotes9396 Рік тому

    wow, 👍🏼 Have you found why the video schedule was not working.

    • @jiejenn
      @jiejenn  Рік тому

      Seems like it's a bug with the API.

  • @momoncio
    @momoncio Рік тому

    This videos cannot be public right?

    • @jiejenn
      @jiejenn  Рік тому

      Why not?

    • @jedidiaholadele2086
      @jedidiaholadele2086 Рік тому

      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

    • @user-zw1mu4zb5o
      @user-zw1mu4zb5o 6 місяців тому

      Yes,I met the same issue

    • @user-nl1zm9qx1p
      @user-nl1zm9qx1p 14 днів тому

      Nobody ever mentions this, surprisingly