node ytsr
v3.8.4
لم يعد هذا الريبو مدعومًا، يرجى التفكير في استخدام واجهة برمجة التطبيقات الرسمية بدلاً من ذلك.
حزمة js بسيطة فقط للبحث عن مقاطع الفيديو وقوائم التشغيل وغيرها الكثير على Youtube. لا يتطلب أي تسجيل دخول أو مفتاح Google-API.
يمكنك الاتصال بنا للحصول على الدعم على خادم الدردشة لدينا
const ytsr = require ( 'ytsr' ) ;
const searchResults = await ytsr ( 'github' ) ;
يبحث عن السلسلة المحددة
searchString
options
US
- يسمح بترجمة الطلبen
- يسمح بترجمة الطلبيعود الوعد
رد المثال
يسحب المرشحات المتاحة للسلسلة أو الرابط المحدد
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
- يسمح بترجمة الطلبen
- يسمح بترجمة الطلبMap<String, Map<String, Filter>>
يواصل الطلب السابق عن طريق سحب صفحة أخرى.
كان يجب تنفيذ الطلب السابق باستخدام حدود pages
.
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 }
npm install --save ytsr
معهد ماساتشوستس للتكنولوجيا