Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Unable to check if new youtube video is uploaded

$
0
0

I want to know when someone upload a new video to his / her youtube channel 'https://www.youtube.com/@some-name-xyz'.

from googleapiclient.discovery import buildfrom datetime import datetime, timedelta# Replace with your API keyapi_key = "my-api-key"# Replace with the Youtuber's username or channel IDchannel_id = "some-name-xyz"# Build the YouTube API clientyoutube = build('youtube', 'v3', developerKey=api_key)# Call the search.list method to retrieve the latest video uploaded by the Youtubersearch_response = youtube.search().list(    part="snippet",    channelId=channel_id,    maxResults=1,    order="date",    type="video").execute() # <- getting error here# some more code

I am getting error:

Traceback (most recent call last):  File "F:\Mahesh\workspaces\youtube-checker-dl\check-yt.py", line 20, in <module>    ).execute()  File "F:\ProgramFiles\Python310\lib\site-packages\googleapiclient\_helpers.py", line 130, in positional_wrapper    return wrapped(*args, **kwargs)  File "F:\ProgramFiles\Python310\lib\site-packages\googleapiclient\http.py", line 938, in execute    raise HttpError(resp, content, uri=self.uri)googleapiclient.errors.HttpError: <HttpError 400 when requesting https://youtube.googleapis.com/youtube/v3/search?part=snippet&channelId=%40some-name-xyz&maxResults=1&order=date&type=video&key=my-api-key&alt=json returned "Request contains an invalid argument.". Details: "[{'message': 'Request contains an invalid argument.', 'domain': 'global', 'reason': 'badRequest'}]">

What I am missing here?

Reference 1,Reference 2


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>