yt-dash-manifest-generator
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "yt-dash-manifest-generator", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,1 +30,8 @@ # YouTube Dash Manifest Generator NodeJS Documentation | ||
``` | ||
**generate_dash_file_from_formats(VideoFormats, VideoLength)** | ||
Takes an array of formats in the way which yt-dl-core provides it as well as the video length in seconds and generates the xml file | ||
```javascript | ||
const xml_string = generate_dash_file_from_formats(VideoFormats, VideoLength) | ||
``` |
const ytdl = require('ytdl-core'); | ||
const xml = require('xml-js') | ||
class DashGenerator { | ||
// if you already have the getInfo data from ytdl-core use this function | ||
// if you already have the getInfo data from ytdl-core as a string, use this function | ||
static generate_dash_file_from_json_data(JsonStringData, VideoLength) { | ||
@@ -12,2 +12,8 @@ const jsonObject = JSON.parse(JsonStringData) | ||
// use this if you already have aformats array | ||
static generate_dash_file_from_formats(VideoFormats, VideoLength) { | ||
const generatedJSON = this.generate_xmljs_json_from_data(VideoFormats, VideoLength) | ||
return xml.json2xml(generatedJSON) | ||
} | ||
// if you do not have the data from ytdl-core already, use this function | ||
@@ -14,0 +20,0 @@ static async generate_dash_file_from_json_data_from_id(VideoId, VideoLength) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46673
205
37