Giter Site home page Giter Site logo

umitkaanusta / mint-youtube Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 0.0 80.25 MB

Comment analytics tool for YouTube videos

License: GNU Affero General Public License v3.0

Python 61.62% HTML 37.52% CSS 0.58% Dockerfile 0.28%
youtube-videos youtube youtube-api video nlp text-classification text-analysis comment self-hosted channel

mint-youtube's Introduction

mint-youtube: Self-hosted YouTube comment analytics tool

Python version Maintenance License: AGPL v3

Mint is a self-hosted comment analytics tool for YouTube videos.

Demo video (click on the image to watch)

Demo video

Upcoming features / Features in development

  • A simple log to see the results of your past requests to the JSON API

Installation

Pulling from Docker Hub and running

  • Run docker pull umitkaanusta/mint-youtube
  • Run docker run -p 5000:5000 -d umitkaanusta/mint-youtube

Creating your own Docker Image and running it

  • Clone the repository
  • cd to the repo's directory
  • Run docker build -t mint-youtube .
  • Run docker run -p 5000:5000 -d mint-youtube

Installing & running without Docker

  • Clone the repository
  • Run pip install -r requirements.txt
  • Run the script run.py

Usage

Getting visual report

  • Open the home page, paste the link of the video, your YT Data API key and select the language of the comments.
  • Alternatively, send a GET request to
    • /report?video_id=<video_id>&lang=<language>&yt_api_key=<api_key>
  • Test endpoint:
    • /test?lang=<language>

Getting JSON reports

  • Mint has a small JSON API in it

Report for a video

  • Send a GET request to
  • /api/report?video_id=<video_id>&lang=<language>&yt_api_key=<api_key>
  • Test endpoint:
  • /api/test-report?lang=<language>

Report for a channel

  • Send a GET request to
  • /api/channel-report?channel_id=<channel_id>&lang=<language>&max_results=<max_results>&order_by=<order_by>&yt_api_key=<api_key>
  • Query parameter order_by accepts the following: date, rating, title, viewCount
  • order_by is set to relevance by default

Known bugs - not related to Mint

Bug 001

Mint uses youtube-data-api as a Python wrapper of the YouTube Data API v3. The package gives the following error on some cases:

"commenter_channel_id" : item['snippet'].get('authorChannelId').get('value', None),
AttributeError: 'NoneType' object has no attribute 'get'

Our suggested band-aid solution:

  • Go to your local virtual env, find youtube_api under site-packages folder
  • Modify line 233 of parsers.py as the following:
"commenter_channel_id" : None,
  • This change won't affect Mint in the slightest

Citations

@misc{leon_yin_2018_1414418,
  author       = {Leon Yin and
                  Megan Brown},
  title        = {SMAPPNYU/youtube-data-api},
  month        = sep,
  year         = 2018,
  doi          = {10.5281/zenodo.1414418},
  url          = {https://doi.org/10.5281/zenodo.1414418}
}

mint-youtube's People

Contributors

dependabot[bot] avatar umitkaanusta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mint-youtube's Issues

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.