mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
refactor(types): add VideoInfo interface
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import Config from "./config";
|
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 { ContentContainer } from "./types";
|
||||||
import Utils from "./utils";
|
import Utils from "./utils";
|
||||||
@@ -25,7 +25,7 @@ let sponsorTimes: SponsorTime[] = null;
|
|||||||
let sponsorVideoID: VideoID = null;
|
let sponsorVideoID: VideoID = null;
|
||||||
|
|
||||||
// JSON video info
|
// JSON video info
|
||||||
let videoInfo: any = null;
|
let videoInfo: VideoInfo = null;
|
||||||
//the channel this video is about
|
//the channel this video is about
|
||||||
let channelID;
|
let channelID;
|
||||||
|
|
||||||
|
|||||||
79
src/types.ts
79
src/types.ts
@@ -78,6 +78,82 @@ interface BackgroundScriptContainer {
|
|||||||
unregisterFirefoxContentScript: (id: string) => void
|
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;
|
type VideoID = string;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@@ -91,5 +167,6 @@ export {
|
|||||||
SponsorHideType,
|
SponsorHideType,
|
||||||
PreviewBarOption,
|
PreviewBarOption,
|
||||||
Registration,
|
Registration,
|
||||||
BackgroundScriptContainer
|
BackgroundScriptContainer,
|
||||||
|
VideoInfo,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user