Search, download, and upload subtitles programmatically.
تتيح واجهة برمجة التطبيقات API للبحث عن الترجمات للمستخدمين البحث عن ترجمات الأفلام والبرامج التلفزيونية بناءً على معايير مختلفة مثل اسم الفيلم واسم الملف ومعرفات محددة (IMDB، TMDB، SubDL) وأرقام المواسم والحلقات والنوع (فيلم وبرنامج تلفزيوني) وسنة الإصدار واللغات.
العنوان: https://api.subdl.com/api/v1/subtitles
نوع الطلب: GET
أرسل واحدة من هذه المتغيرات كعنوان URL GET
bazarr أو stremio أو kodi أو subdl_player أو custom_integration أو other.إذا نجح الطلب فسيرجع Subdl إليك كائن JSON يحتوي على الحقول التالية:
إذا فشل الطلب يتم إرجاع استجابة الخطأ ككائن JSON يحتوي على الحقول التالية:
أضف رابط الترجمة إلى عنوان dl.subdl.com كما في هذا المثال:
https://dl.subdl.com/subtitle/3197651-3213944.zip
سيتم توفير تحميل ملف srt قريبًا…
{
"query": {
"api_key": "abcdefghisubdl",
"film_name": "Inception",
"type": "movie",
"languages": "EN,FR"
}
}
{
"status": true,
"results": [
{
"imdb_id": "tt1375666",
"tmdb_id": 27205,
"type": "movie",
"name": "Inception",
"sd_id": 123456,
"first_air_date": null,
"year": 2010
}
],
"subtitles": [
{
// تفاصيل الترجمة
}
]
}
تعتبر هذه الواجهة البرمجية API أداة ذكية للمطورين لدمج وظائف البحث عن الترجمات في تطبيقاتهم، مع تقديم خيارات تصفية عديدة لتلبية تفضيلات المستخدمين واحتياجاتهم.
curl -X GET "https://api.subdl.com/api/v1/subtitles?api_key=example-api-key&film_name=Inception&type=movie&languages=EN"
fetch(
"https://api.subdl.com/api/v1/subtitles?api_key=example-api-key&film_name=Inception&type=movie&languages=ar",
{
method: "GET",
headers: {
Accept: "application/json",
},
}
)
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("خطأ:", error));تتيح واجهة برمجة تطبيقات رفع الترجمات للمستخدمين رفع ملفات الترجمة للأفلام أو المسلسلات التلفزيونية. تتضمن عملية الرفع ثلاث خطوات: الحصول على معرّف فريد، ورفع ملف الترجمة، وإرسال البيانات الوصفية للترجمة المرفوعة.
قبل رفع ملف الترجمة، تحتاج إلى الحصول على معرّف فريد (n_id).
نقطة النهاية: https://api3.subdl.com/user/getNId
الطريقة: GET
الرؤوس المطلوبة:
{
"ok": true,
"n_id": "iwpVZm9Sva",
"error": null
}
{
"ok": false,
"n_id": null,
"error": "رسالة الخطأ"
}
بعد الحصول على n_id، يمكنك رفع ملف الترجمة.
نقطة النهاية: https://api3.subdl.com/user/uploadSingleSubtitle
الطريقة: POST
الرؤوس المطلوبة:
معلمات النموذج:
{
"ok": true,
"n_id": "8aRlnG50ZS",
"file": {
"fileName": "Captain.America.Brave.New.World.2025.1080p.WEB-DL.x264.6CH-Pahe.in.srt",
"info": {
"index": 0,
"e": 1,
"s": 1,
"q": "web",
"hi": false
},
"md5": "",
"file_n_id": "s42RJ00Gae",
"fileSize": 274694
}
}
{
"ok": false,
"error": "رسالة الخطأ"
}
بعد رفع ملف الترجمة، تحتاج إلى إرسال البيانات الوصفية لإكمال عملية الرفع.
نقطة النهاية: https://api3.subdl.com/user/uploadSubtitle
الطريقة: POST
الرؤوس المطلوبة:
معلمات النموذج:
["r5mEd88x1P"])["Captain.America.Brave.New.World.2025.1080p.WEB-DL.x264.6CH-Pahe.in"])القيم التالية مقبولة لمعلمة معدل الإطارات:
| القيمة | معدل الإطارات |
|---|---|
| 0 | افتراضي |
| 2 | 23.976 |
| 6 | 23.980 |
| 5 | 24.000 |
| 3 | 25.000 |
| 4 | 29.970 |
| 7 | 30.000 |
{
"status": true,
"message": "تم إرسال الترجمة للمراجعة"
}
{
"status": false,
"message": "رسالة الخطأ"
}
curl --location 'https://api3.subdl.com/user/getNId' \
--header 'token: YOUR_TOKEN'
curl --location 'https://api3.subdl.com/user/uploadSingleSubtitle' \
--header 'token: YOUR_TOKEN' \
--form 'subtitle=@"/path/to/your/subtitle.srt"' \
--form 'n_id="iwpVZm9Sva"'
curl --location 'https://api3.subdl.com/user/uploadSubtitle' \
--header 'token: YOUR_TOKEN' \
--form 'file_n_ids=["r5mEd88x1P"]' \
--form 'tmdb_id=822119' \
--form 'type=movie' \
--form 'quality=web' \
--form 'production_type=0' \
--form 'name=Captain America Subtitle' \
--form 'releases=["Captain.America.Brave.New.World.2025.1080p.WEB-DL.x264.6CH-Pahe.in"]' \
--form 'framerate=0' \
--form 'comment=' \
--form 'lang=Serbian' \
--form 'season=0' \
--form 'hi=false' \
--form 'is_full_season=false' \
--form 'n_id=12g74yIzR9N' \
--form 'tags=[]'
// الخطوة الأولى: الحصول على معرّف فريد
async function getNId(token) {
const response = await fetch("https://api3.subdl.com/user/getNId", {
method: "GET",
headers: {
token: token,
},
})
return await response.json()
}
// الخطوة الثانية: رفع ملف الترجمة
async function uploadSubtitleFile(
token,
subtitleFile,
n_id = null,
file_n_id = null
) {
const formData = new FormData()
formData.append("subtitle", subtitleFile)
if (n_id) formData.append("n_id", n_id)
if (file_n_id) formData.append("file_n_id", file_n_id)
const response = await fetch(
"https://api3.subdl.com/user/uploadSingleSubtitle",
{
method: "POST",
headers: {
token: token,
},
body: formData,
}
)
return await response.json()
}
// الخطوة الثالثة: إكمال رفع الترجمة
async function completeSubtitleUpload(bearerToken, uploadData) {
const formData = new FormData()
formData.append("file_n_ids", JSON.stringify(uploadData.file_n_ids))
formData.append("tmdb_id", uploadData.tmdb_id)
formData.append("type", uploadData.type)
formData.append("quality", uploadData.quality)
formData.append("production_type", uploadData.production_type)
formData.append("name", uploadData.name)
formData.append("releases", JSON.stringify(uploadData.releases))
formData.append("framerate", uploadData.framerate)
formData.append("comment", uploadData.comment)
formData.append("lang", uploadData.lang)
formData.append("season", uploadData.season)
formData.append("hi", uploadData.hi)
formData.append("is_full_season", uploadData.is_full_season)
formData.append("n_id", uploadData.n_id)
// معلمات اختيارية
if (uploadData.tags) formData.append("tags", JSON.stringify(uploadData.tags))
if (uploadData.imdb_id) formData.append("imdb_id", uploadData.imdb_id)
if (uploadData.ef) formData.append("ef", uploadData.ef)
if (uploadData.ee) formData.append("ee", uploadData.ee)
if (uploadData.sd_id) formData.append("sd_id", uploadData.sd_id)
const response = await fetch("https://api3.subdl.com/user/uploadSubtitle", {
method: "POST",
headers: {
token: `Bearer ${bearerToken}`,
},
body: formData,
})
return await response.json()
}