Python Forum
How to check if video has been deleted or removed in youtube using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check if video has been deleted or removed in youtube using python
#5
(Apr-10-2018, 05:18 PM)snippsat Wrote: Then can write code.
import requests
from pprint import pprint

id_of_video = 'CUNq2_VjRn4'
your_api_key = 'xxxxxxxxxxxxxx'

url = f'https://www.googleapis.com/youtube/v3/videos?id={id_of_video}&key={your_api_key}&part=status'
url_get = requests.get(url)
pprint(url_get.json())

I tried the above code (after entering in 'id_of_video' and 'your_api_key' and got an error ..

Quote:url = f'https://www.googleapis.com/youtube/v3/videos?id={id_of_video}&key={your_api_key}&part=status'
^
SyntaxError: invalid syntax

Then noticed the f, removed it an whilst the script ran okay, this is what was displayed

Quote:{'error': {'code': 400,
'errors': [{'domain': 'usageLimits',
'message': 'Bad Request',
'reason': 'keyInvalid'}],
'message': 'Bad Request'}}
Reply


Messages In This Thread
RE: How to check if video has been deleted or removed in youtube using python - by jehoshua - Feb-16-2020, 05:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Thread deleted ChrisOfBristol 0 310 Apr-10-2024, 02:47 AM
Last Post: ChrisOfBristol
  Video recording with Raspberry Pi - What´s wrong with my python code? Montezuma1502 3 1,411 Feb-24-2023, 06:14 PM
Last Post: deanhystad
  How to output Python in Spout or any other video sharing network? buzzdarkyear 4 2,307 Jan-11-2022, 11:37 AM
Last Post: buzzdarkyear
  deleted Overdue 0 1,300 Dec-14-2021, 06:57 PM
Last Post: Overdue
  How to make a bot in pycharm for youtube for automatically adding python comments kodek2222 1 2,167 Jan-21-2021, 12:47 PM
Last Post: Aspire2Inspire
  How to preserve x-axis labels despite deleted subplot? Mark17 1 2,059 Dec-23-2020, 09:02 PM
Last Post: Mark17
  Openpyxl: Excel formula & condition formatting removed JaneTan 0 3,788 Sep-25-2020, 07:02 AM
Last Post: JaneTan
  Why is one duplicate not removed? Emekadavid 4 2,461 Jun-09-2020, 06:34 PM
Last Post: perfringo
  How to get Data-Taken For a Video file using Python ramprasad1211 1 1,984 Apr-28-2020, 08:48 AM
Last Post: ndc85430
  Get list of Video Device in python on Windows machine Michal 1 10,813 Apr-03-2020, 06:57 PM
Last Post: Mateusz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020