srcecde / python-youtube-api Goto Github PK
View Code? Open in Web Editor NEWA basic Python YouTube v3 API to fetch data from YouTube using public API-Key without OAuth
License: GNU General Public License v3.0
A basic Python YouTube v3 API to fetch data from YouTube using public API-Key without OAuth
License: GNU General Public License v3.0
This is the full error message when file is executed using :
python-youtube-api-master % python3 main.py --c --max 10 --videourl https://youtu.be/y_j-r8x1FtI --key AAAAAA
(Here i used copy video url after right clicking on video
Traceback (most recent call last):
File "main.py", line 59, in <module>
main()
File "main.py", line 50, in main
vid = q["v"][0]
KeyError: 'v'
Error message when i execute using the same command in the ReadME file :
python3 main.py --c --max 10 --videourl https://www.youtube.com/watch?v=y_j-r8x1FtI --key AAAAAAA
zsh: no matches found: https://www.youtube.com/watch?v=y_j-r8x1FtI
^ title
It would be nice to install the api from PyPi. The script could be in the library
From the documentation:
replies.comments[] A list of one or more replies to the top-level comment. Each item in the list is a comment resource.
The list contains a limited number of replies, and unless the number of items in the list equals the value of the snippet.totalReplyCount property, the list of replies is only a subset of the total number of replies available for the top-level comment. To retrieve all of the replies for the top-level comment, you need to call the comments.list method and use the parentId request parameter to identify the comment for which you want to retrieve replies.
https://developers.google.com/youtube/v3/docs/commentThreads
I've addressed this in my fork by creating a new method get_comment_replies() that uses 'https://www.googleapis.com/youtube/v3/comments' instead of 'https://www.googleapis.com/youtube/v3/commentThreads' and takes the parentId as a parameter. The load_comments() method then calls this method if a topLevelComment has one or more replies.
when i make this example :
python youtube_api_cmd.py --sc UCelk6aHijZq-GJBBB9YpReA 100 AIzaS************Q
it gives me this error :
usage: youtube_api_cmd.py [-h] [--sc] [--channelid CHANNELID] [--max MAX]
[--key KEY]
youtube_api_cmd.py: error: unrecognized arguments: UCelk6aHijZq-GJBBB9YpReA 100 AIzaS********Q
On multiple machines I've been getting this error when using the fetch comment feature from a video url:
Traceback (most recent call last):
File "main.py", line 58, in
main()
File "main.py", line 52, in main
vc.get_video_comments()
File "/content/python-youtube-api/youtube/video_comments.py", line 52, in get_video_comments
self.load_comments(url_response)
File "/content/python-youtube-api/youtube/video_comments.py", line 27, in load_comments
for item in mat["items"]:
KeyError: 'items'
Anyone else getting this problem or have figured it out?
Yet, the output is printed on the console. So, let's save that outcome in CSV file using pandas
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.