Leslie Ryan
Leslie Ryan

Reputation: 29

How to upload one youtube video on another youtube channel with PHP

I am trying to implement functionality where user can upload Youtuve video to his youtube channel. from here i find the way how to upload video in youtube channel. and it is working successfully but in video when i try to upload video of youtube channel

like

$videoName ="https://www.youtube.com/watch?v=AmAmK6HlYAY"

than it gives me error

An client error occurred: Error calling PUT https://www.googleapis.com/upload/youtube/v3/videos?part=status%2Csnippet&uploadType=resumable&upload_id=AEnB2Uq6n4LNSOuTVnC8bJ_R7tRjv3_dEqvr76j_TRKwLzF7Pasme_WOZi6N3LjI1UOJr8RZwCsg6gEotHPl-EMlEXQ2MkSk9g: (400) Failed to parse Content-Range header. how should i can do this..

I simple i want youtube video on my youtube channel with php program.

Upvotes: 2

Views: 2582

Answers (2)

BillK
BillK

Reputation: 317

I just encountered this problem and found this question. In my case, the video to be uploaded was not on the specified path. So, you can add trying to upload a non-existent video to the list of reasons for the failed to parse Content-Range header error message.

Upvotes: 1

Hardik Raval
Hardik Raval

Reputation: 3641

I had same issue, in this case double check video type and most important its take some time to upload video.

So i had put set_time_limit(120); at top of my script and fixed my issue.

Sometimes it is uploading in background in YouTube, check "video manager" after login with Google account. https://www.youtube.com/my_videos?o=U

YouTube -> My Channel -> Video Manager

Upvotes: 2

Related Questions