Skip to main content

youtubepy is a package to search for youtube videos with python

Project description

youtubepy

youtubepy is a package to search for youtube videos through python code.

Usage

Video class

from youtubepy import Video
video = Video("me at the zoo")
result = video.search()
print(result)
> YouTubePY - Searching for the video
> https://www.youtube.com/watch?v=A8AlbaDmaec

SafeSearch Filter

from youtubepy import Video
video = Video("fuck", safesearch=True)
result = video.search()
print(result)

> YouTubePY - Searching for the video
> "youtubepy.BlockedWordError: A blocked word detected in the result video! Don't use safesearch to ignore this error!"

Functions available in Video class

search() - Returns video url
source_url() - Returns the source url of the video
audio_source() - Returns the audio source url of the video
download(/path/to/directory/filename.mp4) - Downloads the video
audio_download(/path/to/directory/filename.mp3) - Downloads the audio of a youtube video
title() - Returns video title
description() - Returns description of the video
channel_url() - Returns the url of the channel that published the video
channel_name() - Returns the name of the channel that published the video
published_date() - Returns the date the video was published to YouTube
thumbnail_url() - Returns thumbnail url of the video
thumbnail_save(/path/to/directory/filename.jpg) - Saves the thumbnail of the video, if path is not given, saves to the path in which the script is saved
duration() - Returns duration of the video
view_count() - Returns view count of the video
like_count() - Returns like count of the video
dislike_count() - Returns dislike count of the video
average_rating() - Returns average rating of the video

ExtractData class

from youtubepy import ExtractData
video = ExtractData("https://youtu.be/A8AlbaDmaec")
title = video.title()
print(title)
> YouTubePY - Extracting video data
> Me at the zoo - 4k Upscaled, 60 FPS

Functions available in ExtractData class

source_url() - Returns the source url of the video
audio_source() - Returns the audio source url of the video
download(/path/to/directory/filename.mp4) - Downloads the video
audio_download(/path/to/directory/filename.mp3) - Downloads the audio of a youtube video
title() - Returns video title
description() - Returns description of the video
channel_url() - Returns the url of the channel that published the video
channel_name() - Returns the name of the channel that published the video
published_date() - Returns the date the video was published to YouTube
thumbnail_url() - Returns thumbnail url of the video
thumbnail_save(/path/to/directory/to/save/filename.jpg) - Saves the thumbnail of the video, if path is not given, saves to the path in which the script is saved
duration() - Returns duration of the video
view_count() - Returns view count of the video
like_count() - Returns like count of the video
dislike_count() - Returns dislike count of the video
average_rating() - Returns average rating of the video

Removing Prints

from youtubepy import *

video = Video("spooky scary skeletons", quiet=True) #quiet kwarg helps in removing the prints
extractdata = ExtractData("spooky scary skeletons", quiet=True) #quiet kwarg is available for ExtractData class also to remove the prints

Note - You may experience glitches in other versions, this version is free from all known bugs and glitches and has many new features compared to other versions!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

youtubepy-5.0.5.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

youtubepy-5.0.5-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file youtubepy-5.0.5.tar.gz.

File metadata

  • Download URL: youtubepy-5.0.5.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for youtubepy-5.0.5.tar.gz
Algorithm Hash digest
SHA256 34913d2bc5c614ca9efd5ddc4f262f14cc14f077ec90586b8a9b9512ca81f2b8
MD5 aa285b414e8caac33065acdc88946054
BLAKE2b-256 c4d94737fa20c3f519dcc0d3d283ca7cc0d55f395cff58181b67b13909239861

See more details on using hashes here.

File details

Details for the file youtubepy-5.0.5-py3-none-any.whl.

File metadata

  • Download URL: youtubepy-5.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for youtubepy-5.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bcdecf0f12c83a9ea537f211160156b44f14272d15069b383ff01929790dd009
MD5 dc749f4e487976962c8bb04eba0531a7
BLAKE2b-256 055d79f4d01bf72e5a501fc3fff2abd9879a9de129da2c608e76a0b155bd6418

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page