Code Monkey home page Code Monkey logo

youtube-downloader's Introduction

youtube-downloader

This is a library to search words on Youtube, download videos about these words and extract screenshots from the videos. You specify a word to search and the end result is a folder with images extracted from the first few videos about that word on Youtube. The packages that are necessary to install in order to run the functions are BeautifulSoup, OpenCV and pytube.

The functionalities can be accessed by simply importing the function extract_images_from_word to a new script. This function takes in as argument the word to search. The optional inputs are

  • image_delay, to decide how much time between the screenshots
  • delete_video, to decide if the videos are deleted after being used
  • num_urls, to decide how many videos to (try to) download
  • max_images, to fix a maximum number of images to extract for each video
  • name, to change the names of the files, which are of the form "name_##.jpg", the folder called name will contain the images
  • max_duration, to decide the maximum length of the videos to download (in minutes)
  • silent, to decide if messages about the saved images are printed, messages about the videos downloaded are always printed

The other functions in the library can be useful separately as well.

  • extract_images_from_video: uses a .mp4 file to exract images
  • download_video: takes the url of the video and downloads it
  • get_urls: search for a specific word and returns a list of urls for the videos
  • max_label: find the maximum label for files called "name_##.jpg" in a folder

I also wrote a blog post about this program for more details: https://medium.com/@yan.gobeil/making-an-image-dataset-from-youtube-videos-5116252d20a3

youtube-downloader's People

Contributors

yangobeil avatar

Watchers

James Cloos 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.