403 Errors Fix
403 Errors Fix
This commit is contained in:
commit
3c0e358e20
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "play-dl",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "play-dl",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"got": "^11.8.2"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "play-dl",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"description": "YouTube, SoundCloud, Spotify streaming for discord.js bots",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
|
||||
@ -43,14 +43,14 @@ export async function stream(url : string, cookie? : string): Promise<Stream | L
|
||||
return new LiveStreaming(info.LiveStreamData.dashManifestUrl, info.format[info.format.length - 1].targetDurationSec, info.video_details.url)
|
||||
}
|
||||
|
||||
let response = await got(info.format[info.format.length - 1].url, {
|
||||
await got(info.format[info.format.length - 1].url, {
|
||||
headers : {
|
||||
"range" : `bytes=0-1`
|
||||
}
|
||||
})
|
||||
if(response.statusCode >= 400){
|
||||
},
|
||||
retry : 0
|
||||
}).catch(async () => {
|
||||
return await stream(info.video_details.url)
|
||||
}
|
||||
})
|
||||
|
||||
let audioFormat = parseAudioFormats(info.format)
|
||||
let opusFormats = filterFormat(audioFormat, "opus")
|
||||
@ -79,14 +79,14 @@ export async function stream_from_info(info : InfoData): Promise<Stream | LiveSt
|
||||
return new LiveStreaming(info.LiveStreamData.dashManifestUrl, info.format[info.format.length - 1].targetDurationSec, info.video_details.url)
|
||||
}
|
||||
|
||||
let response = await got(info.format[info.format.length - 1].url, {
|
||||
await got(info.format[info.format.length - 1].url, {
|
||||
headers : {
|
||||
"range" : `bytes=0-1`
|
||||
}
|
||||
})
|
||||
if(response.statusCode >= 400){
|
||||
},
|
||||
retry : 0
|
||||
}).catch(async () => {
|
||||
return await stream(info.video_details.url)
|
||||
}
|
||||
})
|
||||
|
||||
let audioFormat = parseAudioFormats(info.format)
|
||||
let opusFormats = filterFormat(audioFormat, "opus")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user