mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
refactor(types): add VideoInfo interface
This commit is contained in:
parent
7756a89960
commit
b7ea5689c7
2 changed files with 80 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
import Config from "./config";
|
||||
|
||||
import { SponsorTime, CategorySkipOption, VideoID, SponsorHideType, FetchResponse } from "./types";
|
||||
import { SponsorTime, CategorySkipOption, VideoID, SponsorHideType, FetchResponse, VideoInfo } from "./types";
|
||||
|
||||
import { ContentContainer } from "./types";
|
||||
import Utils from "./utils";
|
||||
|
@ -25,7 +25,7 @@ let sponsorTimes: SponsorTime[] = null;
|
|||
let sponsorVideoID: VideoID = null;
|
||||
|
||||
// JSON video info
|
||||
let videoInfo: any = null;
|
||||
let videoInfo: VideoInfo = null;
|
||||
//the channel this video is about
|
||||
let channelID;
|
||||
|
||||
|
|
79
src/types.ts
79
src/types.ts
|
@ -78,6 +78,82 @@ interface BackgroundScriptContainer {
|
|||
unregisterFirefoxContentScript: (id: string) => void
|
||||
}
|
||||
|
||||
interface VideoInfo {
|
||||
responseContext: {
|
||||
serviceTrackingParams: Array<{service: string, params: Array<{key: string, value: string}>}>,
|
||||
webResponseContextExtensionData: {
|
||||
hasDecorated: boolean
|
||||
}
|
||||
},
|
||||
playabilityStatus: {
|
||||
status: string,
|
||||
playableInEmbed: boolean,
|
||||
miniplayer: {
|
||||
miniplayerRenderer: {
|
||||
playbackMode: string
|
||||
}
|
||||
}
|
||||
};
|
||||
streamingData: unknown;
|
||||
playbackTracking: unknown;
|
||||
videoDetails: {
|
||||
videoId: string,
|
||||
title: string,
|
||||
lengthSeconds: string,
|
||||
keywords: string[],
|
||||
channelId: string,
|
||||
isOwnerViewing: boolean,
|
||||
shortDescription: string,
|
||||
isCrawlable: boolean,
|
||||
thumbnail: {
|
||||
thumbnails: Array<{url: string, width: number, height: number}>
|
||||
},
|
||||
averageRating: number,
|
||||
allowRatings: boolean,
|
||||
viewCount: string,
|
||||
author: string,
|
||||
isPrivate: boolean,
|
||||
isUnpluggedCorpus: boolean,
|
||||
isLiveContent: boolean,
|
||||
};
|
||||
playerConfig: unknown;
|
||||
storyboards: unknown;
|
||||
microformat: {
|
||||
playerMicroformatRenderer: {
|
||||
thumbnail: {
|
||||
thumbnails: Array<{url: string, width: number, height: number}>
|
||||
},
|
||||
embed: {
|
||||
iframeUrl: string,
|
||||
flashUrl: string,
|
||||
width: number,
|
||||
height: number,
|
||||
flashSecureUrl: string,
|
||||
},
|
||||
title: {
|
||||
simpleText: string,
|
||||
},
|
||||
description: {
|
||||
simpleText: string,
|
||||
},
|
||||
lengthSeconds: string,
|
||||
ownerProfileUrl: string,
|
||||
externalChannelId: string,
|
||||
availableCountries: string[],
|
||||
isUnlisted: boolean,
|
||||
hasYpcMetadata: boolean,
|
||||
viewCount: string,
|
||||
category: string,
|
||||
publishDate: string,
|
||||
ownerChannelName: string,
|
||||
uploadDate: string,
|
||||
}
|
||||
};
|
||||
trackingParams: string;
|
||||
attestation: unknown;
|
||||
messages: unknown;
|
||||
}
|
||||
|
||||
type VideoID = string;
|
||||
|
||||
export {
|
||||
|
@ -91,5 +167,6 @@ export {
|
|||
SponsorHideType,
|
||||
PreviewBarOption,
|
||||
Registration,
|
||||
BackgroundScriptContainer
|
||||
BackgroundScriptContainer,
|
||||
VideoInfo,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue