GithubHelp home page GithubHelp logo

tomrusteze / youtube-scraper Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 62.26 MB

This repository is created for the course Text and Multimedia Mining to easily scrape YouTube videos and comments. These comments are processed using NLP to determine the effect of the removal of the dislike button

Python 1.64% Jupyter Notebook 98.33% Shell 0.04%
nlp python scraper youtube

youtube-scraper's Introduction

txmm-project | Returning the Dislike Button

This repository is created for the course Text and Multimedia Mining to easily scrape YouTube videos and comments.

Gathering data

Create a file api_key.txt with your YouTube API key. You will need a valid API key for the YouTube Data API. It is free and the instructions for doing so are here. It is slightly awkward to get a key, but if you follow the instructions you should be ok.
Use the country_code.txt file to select the country that you want to download the most popular videos from. These are 2 letter country abbreviations according to ISO 3166-1.

Easy usage

For easy usage: Run scrape.sh to scrape the 200 most popular videos with 100 comments on each video and their dislikes.

Advanced usage

Run python3 video_scraper.py --related_seed 50 --required_videos 1000 to scrape 1000 more videos based on the 50 most relevant videos from 50 videos. (Uses a lot of your API quota).
With these videos, we can run python3 comment_scraper.py output/<date>US_videos.csv 1000 to scrape 1000 comments on all the videos that we have just scraped.
We can then run python3 dislike_scraper.py output/<date>US_videos.csv to scrape the dislikes using the Return YouTube Dislike API.

We now have 2 files in our output directory, on these we can perform some mining. See the notebook for more details.

Notebook

If you want to use the data from the paper, then unzip dataset.zip and open the notebook. Otherwise, you can gather your own dataset and use that.

youtube-scraper's People

Contributors

tomrusteze avatar

Watchers

Kostas Georgiou avatar  avatar

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.