Enhanced: Perform YouTube video searches without the API. Fork of original youtube-search by joetats
Project description
youtube_search-fork
This fork adds the ability to search for channels, latest content of a channel and adds videos published date.
Python function for searching for youtube videos to avoid using their heavily rate-limited API
To avoid using the API, this uses the form on the youtube homepage and scrapes the resulting page.
Installation
pip install youtube-search-fork
Example Usage
For a basic search (and all of the current functionality), you can use the search tool as follows:
from youtube_search import YoutubeSearch
videos = YoutubeSearch('search terms', max_results=10).videos_to_json()
channels = YoutubeSearch('search terms', max_results=10).channels_to_json()
print(results)
# returns a json string
########################################
videos = YoutubeSearch('search terms', max_results=10).videos_to_dict()
channels = YoutubeSearch('search terms', max_results=10).channels_to_dict()
print(results)
# returns a dictionary like this:
[{'id': 'UCJWCJC...CieLOLQ', 'name': 'channelName', 'suscriberCountText': '200.000', 'thumbnails': ['URL1', 'URL2'], 'url_suffix': '/user/channelName'}]
#########################################
# Get a channel info and videos:
data = YoutubeSearch.channelInfo(channel_id)
channelInfo = data[0]
print(channelInfo)
$> {'id': 'UCjr2bPAyPV.....8Q', 'name': 'Channel Name', 'avatar': 'https://yt3.ggpht.com/a/AATXAJzuPoT_2M54dus-P2qXgnbY0MPxbkzvwv3muxQn=s176-c-k-c0x00ffffff-no-rj', 'subCount': '24K'}
channelVideoList = data[1]
print(channelVideoList)
$> [{'videoTitle': 'Video title goes here', 'id': 'video_id_here', 'channelName': 'Channel Name', 'views': '17 hours ago', 'timeStamp': '13,661 views', 'videoThumb': 'https://i.ytimg.com/vi/3eC4Hp4MNBA/hqdefault.jpg?sqp=-oaymwEiCKgBEF5IWvKriqkDFQgBFQAAAAAYASUAAMhCPQCAokN4AQ==&rs=AOn4....5o_2mazZd40g_xc_3917M5w', 'channelUrl': '/channel/UCjr2bPA.......gT3W8Q'}, {...}, {...}, ...]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for youtube-search-fork-1.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 782bdb2bd8f3393aaa85bc940b4ef6ceb2f9ac054fc154a0e92c2b4bac0954ba |
|
MD5 | 65c84cf40ab77b9989867a1bddd8f89b |
|
BLAKE2b-256 | 4a1f69223390a495aa423dd5b17ac1fa0ee013e3e7a7e1de632f49f5e672b0f8 |