0

Okay, I'm getting video id's returned from the API after I use the insert function to upload my videos, but I'm not sure if or where they're being uploaded.

youtube_request = youtube.videos().insert(
    part="snippet, status",
    body={
        "snippet": {
            "title": title_input,
                "categoryId": "22"
        },
        "status": {
            "privacyStatus": "unlisted"
        }
    },
    media_body=MediaFileUpload(os_video_path)
)
response = youtube_request.execute()
youtube_id = response['id']

I can't seem to find them when I search youtube by ID. I used the example code from their page, can anyone tell me what I'm doing wrong?

    request = youtube.videos().list(
        part="snippet,contentDetails,statistics",
        id="JmFnvOZDXRc"
    )
    response = request.execute()

Response:

HTTP/1.1 200 
cache-control: private, max-age=0, must-revalidate, no-transform
content-encoding: gzip
content-length: 182
content-type: application/json; charset=UTF-8
date: Wed, 18 Mar 2020 17:03:56 GMT
etag: "SJZWTG6xR0eGuCOh2bX6w3s4F94/3tR7Y4Y9pxhARXrfsYwiDwvvwNg"
expires: Wed, 18 Mar 2020 17:03:56 GMT
server: GSE
vary: Origin, X-Origin

{
 "kind": "youtube#videoListResponse",
 "etag": "\"SJZWTG6xR0eGuCOh2bX6w3s4F94/3tR7Y4Y9pxhARXrfsYwiDwvvwNg\"",
 "pageInfo": {
  "totalResults": 0,
  "resultsPerPage": 0
 },
 "items": []
}
  • Could it simply be a matter of time? What happens if you search for the ID now? – AMC Mar 18 '20 at 19:14
  • Just tried it again... nothing... the ID they give in the example doesn't look like mine... Ks-_Mh1QhMc... Thats not what the id returned by inserting it looks like. – Jennifer Kelley Mar 19 '20 at 15:48
  • That's strange. Unfortunately I probably don't know enough about the library to be of much help :/ – AMC Mar 20 '20 at 00:54

1 Answers1

0

The video didn't show up because it was unlisted. When it is embedded the video id will work.

 <iframe width="560" height="315" src="https://www.youtube.com/embed/{{ video.video_id }}?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>