GithubHelp home page GithubHelp logo

srcecde / python-youtube-api Goto Github PK

View Code? Open in Web Editor NEW
139.0 11.0 65.0 48 KB

A basic Python YouTube v3 API to fetch data from YouTube using public API-Key without OAuth

License: GNU General Public License v3.0

Python 99.45% Makefile 0.55%
youtube-api python-youtube

python-youtube-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-youtube-api's Issues

get_video_comment() only returns 5 replies

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.

Traceback caused when fetching comments from video because of "items"

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?

Error when making "Search Videos by YouTube ChannelId"

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

Error in main.py : line 50, "v" not defined

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

Save output in csv

Yet, the output is printed on the console. So, let's save that outcome in CSV file using pandas.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.