Fixed mobile, Fixed no audio?
This commit is contained in:
parent
9a6cf946a6
commit
072987e109
2 changed files with 5 additions and 4 deletions
7
index.js
7
index.js
|
@ -68,14 +68,15 @@ app.get("/getLink", async (req, res) => {
|
|||
}
|
||||
|
||||
if (["mp4", "webm"].includes(format)) {
|
||||
var ytvid = ytdl(url, { 'quality': quality, 'format': format })
|
||||
var ytvid = ytdl(url, { 'quality': quality, 'format': format, 'filter': 'videoandaudio' })
|
||||
var debounce = false
|
||||
ytvid.on("progress", (chunk, cd, td) => {
|
||||
if (!debounce) {
|
||||
res.setHeader('Content-Disposition', `attachment; filename="${filename}.${format}";`);
|
||||
res.setHeader('Content-Disposition', `attachment; filename="${filename}.${format}";`)
|
||||
res.setHeader('Content-Type', `video/${format}`)
|
||||
console.log(`${filename}.${format}"`)
|
||||
res.setHeader("Content-Length", td)
|
||||
ytvid.pipe(res)
|
||||
// console.log(td)
|
||||
debounce = true
|
||||
}
|
||||
})
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<select required id="redirect" name="redirect">
|
||||
<option value="redirectjs">Redirect (JS, reccomended)</option>
|
||||
<option value="false">Don't auto redirect</option>
|
||||
<option value="redirect">Redirect (disables progress, not reccomended)</option>
|
||||
<option value="redirect">Redirect (Not reccomended)</option>
|
||||
</select>
|
||||
</div>
|
||||
<br>
|
||||
|
|
Loading…
Reference in a new issue