ytnoti
v2.1.3
易於使用的Python庫,用於接收YouTube推送通知,以實時上傳和編輯
ytnoti旨在幫助您實時接收YouTube推送通知,以輕鬆有效地上傳和編輯。
該庫通過PubSubHubBub使用YouTube數據API V3接收推送通知,因此您可以實時接收通知,而不必經常進行輪詢YouTube API。
此外,此方法不需要YouTube數據API的任何API密鑰,因此您可以使用此庫而無需任何配額限制。
該庫需要Python 3.11或更高。
pip install ytnoti以下是如何使用Ngrok接收推送通知的一個簡單示例。
from pyngrok import ngrok
from ytnoti import YouTubeNotifier , Video
ngrok . set_auth_token ( "Your ngrok token here" )
notifier = YouTubeNotifier ()
@ notifier . upload ()
async def listener ( video : Video ):
print ( f"New video from { video . channel . name } : { video . title } " )
notifier . subscribe ( "UC9EEyg7QBL-stRX-7hTV3ng" ) # Channel ID of SpeedyStyle
notifier . run ()以下是如何使用您的域接收推送通知的簡單示例。
from ytnoti import YouTubeNotifier , Video
notifier = YouTubeNotifier ( callback_url = "https://yourdomain.com" )
@ notifier . upload ()
async def listener ( video : Video ):
print ( f"New video from { video . channel . name } : { video . title } " )
notifier . subscribe ( "UC9EEyg7QBL-stRX-7hTV3ng" ) # Channel ID of SpeedyStyle
notifier . run ()有關更多示例,請訪問示例文件夾。
在提出問題之前,請閱讀文檔。您的問題可能已經在那裡得到回答。
如果您使用此庫有任何問題,請隨時在問題部分或我的Discord服務器上尋求幫助。
此項目已獲得MIT許可證的許可 - 有關詳細信息,請參見許可證文件。