mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-18 06:09:58 +00:00
twitch: add filename attributes to twitch clips
merge pull request #233 from Snazzah/feat/twitch-pretty
This commit is contained in:
commit
5d1d25a6dd
2 changed files with 11 additions and 2 deletions
|
@ -23,7 +23,7 @@ this list is not final and keeps expanding over time. if support for a service y
|
||||||
| streamable | ✅ | ✅ | ✅ | ➖ | ➖ |
|
| streamable | ✅ | ✅ | ✅ | ➖ | ➖ |
|
||||||
| tiktok | ✅ | ✅ | ✅ | ❌ | ❌ |
|
| tiktok | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||||
| tumblr | ✅ | ✅ | ✅ | ➖ | ➖ |
|
| tumblr | ✅ | ✅ | ✅ | ➖ | ➖ |
|
||||||
| twitch clips | ✅ | ✅ | ✅ | ✅ | ❌ |
|
| twitch clips | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||||
| twitter/x | ✅ | ✅ | ✅ | ➖ | ➖ |
|
| twitter/x | ✅ | ✅ | ✅ | ➖ | ➖ |
|
||||||
| vimeo | ✅ | ✅ | ✅ | ✅ | ✅ |
|
| vimeo | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||||
| vine archive | ✅ | ✅ | ✅ | ➖ | ➖ |
|
| vine archive | ✅ | ✅ | ✅ | ➖ | ➖ |
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { maxVideoDuration } from "../../config.js";
|
import { maxVideoDuration } from "../../config.js";
|
||||||
|
import { cleanString } from '../../sub/utils.js';
|
||||||
|
|
||||||
const gqlURL = "https://gql.twitch.tv/gql";
|
const gqlURL = "https://gql.twitch.tv/gql";
|
||||||
const clientIdHead = { "client-id": "kimne78kx3ncx6brgo4mv6wki5h1ko" };
|
const clientIdHead = { "client-id": "kimne78kx3ncx6brgo4mv6wki5h1ko" };
|
||||||
|
@ -67,9 +68,17 @@ export default async function (obj) {
|
||||||
token: req_token[0].data.clip.playbackAccessToken.value
|
token: req_token[0].data.clip.playbackAccessToken.value
|
||||||
})}`,
|
})}`,
|
||||||
fileMetadata: {
|
fileMetadata: {
|
||||||
title: clipMetadata.title,
|
title: cleanString(clipMetadata.title.trim()),
|
||||||
artist: `Twitch Clip by @${clipMetadata.broadcaster.login}, clipped by @${clipMetadata.curator.login}`,
|
artist: `Twitch Clip by @${clipMetadata.broadcaster.login}, clipped by @${clipMetadata.curator.login}`,
|
||||||
},
|
},
|
||||||
|
filenameAttributes: {
|
||||||
|
service: "twitch",
|
||||||
|
id: clipMetadata.id,
|
||||||
|
title: cleanString(clipMetadata.title.trim()),
|
||||||
|
author: `${clipMetadata.broadcaster.login}, clipped by ${clipMetadata.curator.login}`,
|
||||||
|
qualityLabel: `${format.quality}p`,
|
||||||
|
extension: 'mp4'
|
||||||
|
},
|
||||||
filename: `twitchclip_${clipMetadata.id}_${format.quality}p.mp4`,
|
filename: `twitchclip_${clipMetadata.id}_${format.quality}p.mp4`,
|
||||||
audioFilename: `twitchclip_${clipMetadata.id}_audio`
|
audioFilename: `twitchclip_${clipMetadata.id}_audio`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue