node ytsr
v3.8.4
Dieses Repo wird nicht mehr unterstützt. Bitte verwenden Sie stattdessen die offizielle API.
Einfaches Nur-JS-Paket zur Suche auf YouTube nach Videos, Playlists und vielem mehr. Erfordert kein Login oder Google-API-Key.
Sie können uns für Support auf unserem Chat-Server kontaktieren
const ytsr = require ( 'ytsr' ) ;
const searchResults = await ytsr ( 'github' ) ;
Sucht nach der angegebenen Zeichenfolge
searchString
options
US
– Ermöglicht die Lokalisierung der Anfrageen
– Ermöglicht die Lokalisierung der Anfragegibt ein Versprechen zurück
Beispielantwort
Ruft verfügbare Filter für die angegebene Zeichenfolge oder den angegebenen Link ab
const ytsr = require ( 'ytsr' ) ;
const filters1 = await ytsr . getFilters ( 'github' ) ;
const filter1 = filters1 . get ( 'Type' ) . get ( 'Video' ) ;
const filters2 = await ytsr . getFilters ( filter1 . url ) ;
const filter2 = filters2 . get ( 'Features' ) . get ( 'Live' ) ;
const options = {
pages : 2 ,
}
const searchResults = await ytsr ( filter2 . url , options ) ;
searchString
options
US
– Ermöglicht die Lokalisierung der Anfrageen
– Ermöglicht die Lokalisierung der AnfrageMap<String, Map<String, Filter>>
führt Setzt eine vorherige Anfrage fort, indem eine weitere Seite aufgerufen wird.
Die vorherige Anfrage musste mithilfe der pages
erfolgen.
const ytsr = require ( 'ytsr' ) ;
const firstResultBatch = await ytsr ( 'github' , { pages : 1 } ) ;
const secondResultBatch = ytsr . continueReq ( firstResultBatch . continuation ) ;
const thirdResultBatch = ytsr . continueReq ( secondResultBatch . continuation ) ;
// You can now use the .items property of all result batches e.g.:
console . log ( firstResultBatch . items ) ;
console . log ( secondResultBatch . items ) ;
console . log ( thirdResultBatch . items ) ;
{ continuation, items }
aufgelöst wird npm install --save ytsr
MIT