Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Python 3.6.x or higher is required.
Install command:
# Linux/OS X
$ python -m pip install -U yt-search
# Windows
> py -3 -m pip install -U yt-search
Search video
import yt_search
yt = yt_search.build("API Key")
search_result = yt.search("keyword", sMax=10, sType=["video"])
print(search_result.title)
print(search_result.videoId)
print(search_result.channelTitle)
Search YouTube channel
import yt_search
yt = yt_search.build("API Key")
search_result = yt.search("keyword", sMax=10, sType=["channel"])
print(search_result.channelTitle)
print(search_result.channelId)
Search playlist
import yt_search
yt = yt_search.build("API Key")
search_result = yt.search("keyword", sMax=10, sType=["playlist"])
print(search_result.title)
print(search_result.playlistId)
print(search_result.channelTitle)
sType can be select multiple by list
import yt_search
yt = yt_search.build("API Key")
search_result = yt.search("keyword", sMax=10, sType=["video", "playlist"])
print(search_result.title)
print(search_result.videoId)
print(search_result.playlistId)
print(search_result.channelTitle)
Download search results with wav
Need youtube-dl and ffmpeg.
import yt_search
import youtube_dl
yt = yt_search.build("API Key")
search_result = yt.search("keyword", sMax=10, sType=["video"])
options = {
'format': 'bestaudio/bestaudio',
'outtmpl': '%(title)s.%(ext)s',
'postprocessors': [
{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'wav'
},
{
'key': 'FFmpegMetadata'
}
]
}
with youtube_dl.YoutubeDL(options) as ydl:
ydl.download(["https://www.youtube.com/watch?v=" + i
for i in search_result.videoId])
In the case of youtube#video, playlistId returns None. In the case of youtube#playlist, videoId returns None. In the case of youtube#channel, playlistId and videoId returns None.
Python3.6.x以上が必要です。
インストールコマンド:
# Linux/OS X
$ python -m pip install -U yt-search
# Windows
> py -3 -m pip install -U yt-search
動画を検索
import yt_search
yt = yt_search.build("APIキー")
search_result = yt.search("キーワード", sMax=10, sType=["video"])
print(search_result.title)
print(search_result.videoId)
print(search_result.channelTitle)
YouTubeチャンネルを検索
import yt_search
yt = yt_search.build("APIキー")
search_result = yt.search("キーワード", sMax=10, sType=["channel"])
print(search_result.channelTitle)
print(search_result.channelId)
プレイリストを検索
import yt_search
yt = yt_search.build("APIキー")
search_result = yt.search("キーワード", sMax=10, sType=["playlist"])
print(search_result.title)
print(search_result.playlistId)
print(search_result.channelTitle)
sTypeはリストで複数選択可能です。例:
import yt_search
yt = yt_search.build("APIキー")
search_result = yt.search("キーワード", sMax=10, sType=["video", "playlist"])
print(search_result.title)
print(search_result.videoId)
print(search_result.playlistId)
print(search_result.channelTitle)
検索結果をwavでダウンロード
youtube-dlとffmpegが必要です。
import yt_search
import youtube_dl
yt = yt_search.build("APIキー")
search_result = yt.search("キーワード", sMax=10, sType=["video"])
options = {
'format': 'bestaudio/bestaudio',
'outtmpl': '%(title)s.%(ext)s',
'postprocessors': [
{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'wav'
},
{
'key': 'FFmpegMetadata'
}
]
}
with youtube_dl.YoutubeDL(options) as ydl:
ydl.download(["https://www.youtube.com/watch?v=" + i
for i in search_result.videoId])
youtube#videoの場合はplaylistIdが、 youtube#playlistの場合はvideoIdが、 youtube#channelの場合はplaylistIdとvideoIdがNoneを返します。 Noneを返さない場合もあります(値があるとき)
FAQs
Search contents on YouTube.
We found that yt-search demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.