a python library for youtube blocking function.
Project description
pytblocklib
Overview
( This project is under development. )
Pytblocklib is an library for blocking spam bots on YouTube.
Pytblocklib は、Youtubeのスパムボットのブロックを補助するライブラリです。
YouTube API設定不要、リスナー側のブロックにも対応しています。
詳細はwiki を参照してください。
Description
Pytblocklibs's goal is to provide easy blocking operation on YT.
You can concentrate on thinking block algorithms.
Function around livechat is based on my pytchat script.
Features:
- Functions focused on blocks, light weight, easy operation.
- You can block as a listener. (not need to give or take moderator privileges)
- No Scraping, no Selenium, no BeautifulSoup.
Usage
from pytblocklib import Watcher
import time
w = Watcher("video_id")
NG_WORDS = ['NG_WORD1','NG_WORD2']
blocklist = []
w.start()
#Start checking loop
while w.loop():
#Get chat list from buffer
chats = w.get_chats()
for chat in chats:
for ng_word in NG_WORDS:
if ng_word in chat.message or ng_word in chat.author_name:
print("Found :message-`{}` by {} ".format(chat.message, chat.author_name))
#Block user by specifying author channel id.
w.block(chat.author_id)
blocklist.append(chat.author_id)
time.sleep(3)
#Example: Unblock all blocked users (only available during executing script)
for author_id in blocklist:
w.unblock(author_id)
w.stop()
VS
Nightbot
-
Pros
-
- Sophisticated user interface on browser, integrated functions.
-
- Applicable for Twitch.
-
- Various blocking setting (e.g. blacklist, excess emotes, repetitions)
-
- Applicable to Twitch.
-
Cons
-
- Only srteamers can block spams on their broadcasting with moderator privileges, not per listener.
YouTube Studio
-
Pros
-
- Official features.
-
- Various blocking setting (e.g. specify channel id, prohibited words)
-
Cons
-
- Only srteamers can block spams on their broadcasting with owner/moderator privileges, not per listener.
Pytblocklib
-
Pros
-
- No need for YT API settings.
-
- Simple - functions focused on blocking spams.
-
- You can customize the blocking algorithm with a python script.
-
- You can block spams as a listener. (not need to give or take moderator privileges)
-
Cons
-
- Need to implement blocking procedures and user interface separately.
-
- Less portability : requires python environment. (planning to distribute as executable file)
Using
Customizing
browser_cookie3
original :
https://github.com/borisbabic/browser_cookie3
Requirements
browser_cookie3
pytz
requests
urllib3
LICENSE
GNU LESSER GENERAL PUBLIC LICENSE Version 3
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for pytblocklib-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a45bb856f86903388f5a3339c25e09102760cad6e05e9518fbcec5416db4781 |
|
MD5 | 22113939ad94b3759b5634ffdb811e00 |
|
BLAKE2b-256 | b98123722dbb0ee9c0d7add9f115a09e96ea3203b198984554dfb293b8755d26 |