Unlimited youtube search with web scrapping
Project description
Fast Youtube Search
This is a simple library that allows you to search videos on Youtube.
It is fast because it doesn't use selenium. It scrapes data directly from the html of the results page.
For each video it returns the name, id , and the thumbnail's url.
Install
pip install fast_youtube_search
Usage
from fast_youtube_search import search_youtube
results = search_youtube(['jorja', 'smith']) # receives an array of search terms as argument
print(results) #returns a list of results(dictionaries)
print(results[0]) # a dictionary with properties name, id and img
# OUTPUT
# {
# 'name': 'Jorja Smith - Blue Lights | A COLORS SHOW',
# 'id': 'fYwRsJAPfec',
# 'img': 'https://i.ytimg.com/vi/fYwRsJAPfec/hqdefault.jpg'
# }
#Optional arguments
# retries : the max number of retries for requesting the results page (see below)
# max_num_results : max number of results that the function returns
results = search_youtube(['jorja', 'smith'], retries = 7, max_num_results = 2)
Retries
Youtube sometimes returns html without a list of results. It is necessary to retry a couple of times. Empty results after 3 retries is unlikely (retries = 4 is the default value)
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
Built Distribution
Close
Hashes for fast_youtube_search-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed39425c4c66c9859f5d4d4a2c33385a041c447f2e8489008664110614704709 |
|
MD5 | 08eaf4ff68de8f32476070e8e77d3b2d |
|
BLAKE2b-256 | 3b0c291d5283cb9c3c12ad1bf0b6e7ac83b9fd6be2274cbea7dfdff6a8dbc9b2 |
Close
Hashes for fast_youtube_search-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6be5a5989f515b5f3b03c1c5b23769410a53b2edeff4f234adca1b66ad62145 |
|
MD5 | 1d377e894f3679868c2e5304e2fb89e9 |
|
BLAKE2b-256 | cf35774c94a2e89ff41c8b4596a73406d1c6b6e6fdb3d0b0c5824998c8d926f8 |