mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-09 21:17:15 +03:00
Merge
This commit is contained in:
38
test/youtubeMock.js
Normal file
38
test/youtubeMock.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
YouTubeAPI.videos.list({
|
||||
part: "snippet",
|
||||
id: videoID
|
||||
}, function (err, data) {});
|
||||
*/
|
||||
|
||||
// https://developers.google.com/youtube/v3/docs/videos
|
||||
|
||||
const YouTubeAPI = {
|
||||
videos: {
|
||||
list: (obj, callback) => {
|
||||
if (obj.videoID === "knownWrongID") {
|
||||
callback(undefined, {
|
||||
pageInfo: {
|
||||
totalResults: 0
|
||||
},
|
||||
items: []
|
||||
});
|
||||
} else {
|
||||
callback(undefined, {
|
||||
pageInfo: {
|
||||
totalResults: 1
|
||||
},
|
||||
items: [
|
||||
{
|
||||
contentDetails: {
|
||||
duration: "PT1H23M30S"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = YouTubeAPI;
|
||||
Reference in New Issue
Block a user