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

試著忘記壹切 提交于 2020-01-04 15:30:38

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/30349366/how-to-upload-one-youtube-video-on-another-youtube-channel-with-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!