yt-dash-manifest-generator
Advanced tools
Comparing version 1.0.4 to 1.1.0
module.exports = require("./src/DashGenerator") | ||
// https://second.cadence.moe/api/manifest/dash/id/Ycz6TXrP-W8 | ||
// https://invidio.us/api/manifest/dash/id/Ycz6TXrP-W8 | ||
// https://invidio.us/api/manifest/dash/id/M7VubHR-a3s | ||
{ | ||
"name": "yt-dash-manifest-generator", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# YouTube Dash Manifest Generator NodeJS Documentation | ||
This NodeJS library generates a DASH Manifest file for a YouTube video in order to allow a playback with 1080p+ resolutions. It is developed for and tailored towards easy usage in the [FreeTube](https://github.com/FreeTubeApp/FreeTube-Vue) rewrite but can be used with any other project as well. | ||
It takes the adaptive formats of the response string as input. | ||
If this library should not work at some point, please create an issue and let me know so that I can take a look into it. Pull requests are also welcomed in this case. | ||
@@ -5,0 +5,0 @@ |
@@ -1,2 +0,2 @@ | ||
const ytdl = require('ytdl-core'); | ||
const ytdl = require('ytdl-core') | ||
const xml = require('xml-js') | ||
@@ -7,3 +7,3 @@ class DashGenerator { | ||
const jsonObject = JSON.parse(JsonStringData) | ||
const videoFormats = jsonObject.formats | ||
const videoFormats = jsonObject.player_response.streamingData.adaptiveFormats | ||
const generatedJSON = this.generate_xmljs_json_from_data(videoFormats, VideoLength) | ||
@@ -36,3 +36,3 @@ return xml.json2xml(generatedJSON) | ||
"id": Format.itag, | ||
"codecs": Format.audioCodec, | ||
"codecs": Format.mimeType.split(' ')[1].match(/"[^"]*/)[0].substr(1), | ||
"bandwidth": Format.bitrate | ||
@@ -87,3 +87,3 @@ }, | ||
"id": Format.itag, | ||
"codecs": Format.videoCodec, | ||
"codecs": Format.mimeType.split(' ')[1].match(/"[^"]*/)[0].substr(1), | ||
"bandwidth": Format.bitrate, | ||
@@ -90,0 +90,0 @@ "width": Format.width, |
47029
208