Function to check video url
#1
Hi,

I would like to know if a function can be use to check if video url is ok or not.

Example of an url does not work : http://lh3.googleusercontent.com/Eej2Lce...GE1nNQ=m22

Thank a lot.
Reply
#2
When I want to play video with a bad link I have this error message :
 
Quote:14:36:03.383 T:22476 ERROR: CCurlFile::Stat - Failed: HTTP response code said error(22) for http://lh3.googleusercontent.com/OA_B66n...pTDvAA=m22
14:36:03.387 T:22476 NOTICE: VideoPlayer: Opening: http://lh3.googleusercontent.com/OA_B66n...pTDvAA=m22
14:36:03.387 T:22476 WARNING: CDVDMessageQueue(player):Tongueut MSGQ_NOT_INITIALIZED
14:36:03.630 T:22476 ERROR: CCurlFile::Stat - Failed: HTTP response code said error(22) for http://lh3.googleusercontent.com/OA_B66n...pTDvAA=m22
14:36:03.631 T:22476 ERROR: DXVA::CProcessorHD::IsFormatSupported: Unsupported format 104 for 1.
14:36:03.631 T:22476 ERROR: DXVA::CProcessorHD::IsFormatSupported: Unsupported format 105 for 1.
14:36:03.632 T:2916 NOTICE: Creating InputStream
14:36:03.748 T:2916 ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
14:36:03.748 T:2916 ERROR: CCurlFile::Open failed with code 403 for http://lh3.googleusercontent.com/OA_B66n...pTDvAA=m22
14:36:03.867 T:2916 ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
14:36:03.867 T:2916 ERROR: CCurlFile::Open failed with code 403 for http://lh3.googleusercontent.com/OA_B66n...pTDvAA=m22
14:36:03.867 T:2916 ERROR: XFILE::CFileCache::Open - failed to open source <http://lh3.googleusercontent.com/OA_B66nUoBCzJ0o5FMGgj_IDnP-5IJhhvAJyRVzntx148Jb3Jb6bSisYhcJiVJJUsCJovdYotAiQM3baaRFET4w5lSSH9N1QEFXhpiRvuXsx0XVA9nZefRTWLaEE_H8J5VefpTDvAA=m22>
14:36:03.867 T:2916 ERROR: CVideoPlayer::OpenInputStream - error opening [http://lh3.googleusercontent.com/OA_B66n...pTDvAA=m22]
14:36:03.867 T:2916 NOTICE: CVideoPlayer::OnExit()
14:36:03.867 T:22476 ERROR: Playlist Player: skipping unplayable item: 0, path [http://lh3.googleusercontent.com/OA_B66n...pTDvAA=m22]
14:36:03.939 T:22476 NOTICE: CVideoPlayer::CloseFile()
14:36:03.939 T:22476 NOTICE: VideoPlayer: waiting for threads to exit
14:36:03.939 T:22476 NOTICE: VideoPlayer: finished waiting
14:36:03.939 T:22476 NOTICE: CVideoPlayer::CloseFile()
14:36:03.939 T:22476 NOTICE: VideoPlayer: waiting for threads to exit
14:36:03.939 T:22476 NOTICE: VideoPlayer: finished waiting
I would like with python function to get ERROR message or ERROR code like error 404 for example, if not error is return by function the link is OK.
Reply
#3
python:
import requests

resp = requests.head('http://example.com/example.mp4')
if resp.status_code == 200:
    play_video()
Reply
#4
Smile 
Thank you, it is exactly what I want Image
Reply

Logout Mark Read Team Forum Stats Members Help
Function to check video url0