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 | ✅ | ✅ | ✅ | ➖ | ➖ |
|
||||
| tiktok | ✅ | ✅ | ✅ | ❌ | ❌ |
|
||||
| tumblr | ✅ | ✅ | ✅ | ➖ | ➖ |
|
||||
| twitch clips | ✅ | ✅ | ✅ | ✅ | ❌ |
|
||||
| twitch clips | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| twitter/x | ✅ | ✅ | ✅ | ➖ | ➖ |
|
||||
| vimeo | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| vine archive | ✅ | ✅ | ✅ | ➖ | ➖ |
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { maxVideoDuration } from "../../config.js";
|
||||
import { cleanString } from '../../sub/utils.js';
|
||||
|
||||
const gqlURL = "https://gql.twitch.tv/gql";
|
||||
const clientIdHead = { "client-id": "kimne78kx3ncx6brgo4mv6wki5h1ko" };
|
||||
|
@ -67,9 +68,17 @@ export default async function (obj) {
|
|||
token: req_token[0].data.clip.playbackAccessToken.value
|
||||
})}`,
|
||||
fileMetadata: {
|
||||
title: clipMetadata.title,
|
||||
title: cleanString(clipMetadata.title.trim()),
|
||||
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`,
|
||||
audioFilename: `twitchclip_${clipMetadata.id}_audio`
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue