Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workers code #1

Merged
merged 1 commit into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
workers code
  • Loading branch information
qrprabha committed Jan 11, 2021
commit 0de870374828c8ef874b21f35dc5f9e0fc1f980e
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
*Request:*

```bash
https://vootp.herokuapp.com/?q=https://www.voot.com/movies/k-g-f-chapter-1-hindi/965391
https://vootapi.tk/?q=https://www.voot.com/movies/k-g-f-chapter-1-hindi/965391
```

*Response:*

```json
{
"mediaID": "965391",
"title": "K.G.F: Chapter 1 (Hindi)",
"description": "Rocky, a young man, with an ambition to die as the wealthiest and powerful man embarks on his mission from the streets of Mumbai to lands up in the fields of KGF, where he gets involved with the notorious mine mafia. Will Rocky's journey filled with dangerous inroads lead him to ambitious goal?",
"video_url": "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/0_avlcjzzt/format/applehttp/tags/tv/f/a.m3u8"
"mediaID": "965391",
"Video_URL": "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/0_avlcjzzt/format/applehttp/tags/tv/f/a.m3u8"
}
```

Expand All @@ -26,16 +26,16 @@ https://vootp.herokuapp.com/?q=https://www.voot.com/movies/k-g-f-chapter-1-hindi
*Request:*

```bash
https://vootp.herokuapp.com/?q=https://www.voot.com/shows/bigg-boss/14/978245/papa-ki-pari-hui-emotional/1072176
https://vootapi.tk/?q=https://www.voot.com/shows/bigg-boss/14/978245/papa-ki-pari-hui-emotional/1072176
```

*Response:*

```json
{
"mediaID": "1072176",
"title": "Bigg Boss S14 - Season 14 - Episode 72",
"description": "Day 98: Rashami Desai enters the house to support her friend Vikas Gupta and rebukes Jasmin Bhasin and Aly Goni for bullying Vikas and attacking him personally. Later in the day, Jasmin is elated on seeing her parents enter the house. However, their reunion turns into Aly Goni's worst nightmare as they advise her to concentrate on her game and play solo. With the growing closeness between the two, have Jasmin's parents indirectly rejected Aly? Watch this episode for more, on Voot.",
"video_url": "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/1_ivss21bx/format/applehttp/tags/webnew/f/a.m3u8"
"mediaID": "1072176",
"Video_URL": "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/1_ivss21bx/format/applehttp/tags/webnew/f/a.m3u8"
}
```
1 change: 0 additions & 1 deletion composer.json

This file was deleted.

21 changes: 0 additions & 21 deletions index.php

This file was deleted.

66 changes: 66 additions & 0 deletions workers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {

let req_query = new URL(request.url).searchParams.get('q')


if (req_query == null) {

const reply = {
"status": "failed",
"message": "Send with an url query"
};

return new Response(JSON.stringify(reply), {
headers: {
"content-type": "application/json",
},
})

} else {
var id = req_query.split("/").pop()
}

var result = await fetch(`https://wapi.voot.com/ws/ott/getMediaInfo.json?platform=Web&pId=2&mediaId=${id}`, {
headers: {
'Content-Type': 'application/json'
}
})
var result = await result.json()

const error_msg = {
"status": "failed",
"message": "Invalid URL"
}

if (!result) {
return new Response(JSON.stringify(error_msg), {
status: 400,
headers: ({
"Content-Type": "application/json",
})
})
} else {
var pass = ({
mediaID: result.assets.MediaID,
title: result.assets.MediaName,
description: result.assets.Metas[1].Value,
video: result.assets.Files[3].URL
})
res_data = {
"title": pass.title,
"description": pass.description,
"mediaID": pass.mediaID,
"Video_URL": pass.video
}
return new Response(await JSON.stringify(res_data), {
status: 200,
headers: ({
"Content-Type": "application/json",
})
})
}
}