Compare commits

..

3 Commits

Author SHA1 Message Date
github-actions[bot]
01fd1ee72a chore(main): release 5.1.0 (#403)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-14 01:12:16 -03:00
absidue
84b4f1efd1 feat(toDash): Add audio track labels to the manifest when available (#402) 2023-05-14 01:11:02 -03:00
absidue
046103a4d8 feat(ReelItem): Add accessibility label (#401) 2023-05-14 01:09:51 -03:00
5 changed files with 22 additions and 5 deletions

View File

@@ -1,5 +1,13 @@
# Changelog
## [5.1.0](https://github.com/LuanRT/YouTube.js/compare/v5.0.4...v5.1.0) (2023-05-14)
### Features
* **ReelItem:** Add accessibility label ([#401](https://github.com/LuanRT/YouTube.js/issues/401)) ([046103a](https://github.com/LuanRT/YouTube.js/commit/046103a4d8af09fafefab6e9f971184eeca75c2e))
* **toDash:** Add audio track labels to the manifest when available ([#402](https://github.com/LuanRT/YouTube.js/issues/402)) ([84b4f1e](https://github.com/LuanRT/YouTube.js/commit/84b4f1efd111321e4f3e5a87844790c4ec9b0b52))
## [5.0.4](https://github.com/LuanRT/YouTube.js/compare/v5.0.3...v5.0.4) (2023-05-10)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "youtubei.js",
"version": "5.0.4",
"version": "5.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "youtubei.js",
"version": "5.0.4",
"version": "5.1.0",
"funding": [
"https://github.com/sponsors/LuanRT"
],

View File

@@ -1,6 +1,6 @@
{
"name": "youtubei.js",
"version": "5.0.4",
"version": "5.1.0",
"description": "A wrapper around YouTube's private API. Supports YouTube, YouTube Music, YouTube Kids and YouTube Studio (WIP).",
"type": "module",
"types": "./dist/src/platform/lib.d.ts",

View File

@@ -12,6 +12,7 @@ export default class ReelItem extends YTNode {
thumbnails: Thumbnail[];
views: Text;
endpoint: NavigationEndpoint;
accessibility_label?: string;
constructor(data: RawNode) {
super();
@@ -20,5 +21,6 @@ export default class ReelItem extends YTNode {
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
this.views = new Text(data.viewCountText);
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.accessibility_label = data.accessibility.accessibilityData.label;
}
}

View File

@@ -363,7 +363,12 @@ class FormatUtils {
this.#el(document, 'Role', {
schemeIdUri: 'urn:mpeg:dash:role:2011',
value: role
})
}),
this.#el(document, 'Label', {
id: set_id.toString()
}, [
document.createTextNode(first_format.audio_track?.display_name as string)
])
);
const set = this.#el(document, 'AdaptationSet', {
@@ -371,7 +376,9 @@ class FormatUtils {
mimeType: mime_types[i].split(';')[0],
startWithSAP: '1',
subsegmentAlignment: 'true',
lang: first_format.language as string
lang: first_format.language as string,
// Non-standard attribute used by shaka instead of the standard Label element
label: first_format.audio_track?.display_name as string
}, children);
period.appendChild(set);