New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ytmusic_api_unofficial

Package Overview
Dependencies
Maintainers
0
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ytmusic_api_unofficial - npm Package Compare versions

Comparing version 2.0.6 to 2.0.7

2

dist/utils/decode.d.ts
export declare function getSignatureTimestamp(): Promise<number>;
export declare function getDecodeScript(): Promise<any>;
export declare function getUrlDecode(url: string): Promise<string>;
export declare function getUrlDecode(url: string, retry?: boolean): Promise<string>;
//# sourceMappingURL=decode.d.ts.map

@@ -16,3 +16,2 @@ "use strict";

exports.getUrlDecode = exports.getDecodeScript = exports.getSignatureTimestamp = void 0;
const path_1 = __importDefault(require("path"));
const node_cache_1 = __importDefault(require("node-cache"));

@@ -37,6 +36,10 @@ const error_1 = require("./error");

exports.getDecodeScript = getDecodeScript;
function getUrlDecode(url) {
function getUrlDecode(url, retry = false) {
return new Promise((resolve, reject) => {
getDecodeScript().then((decode) => __awaiter(this, void 0, void 0, function* () {
checkUrlIsMusic(decode(url)).then(resolve).catch(reject);
checkUrlIsMusic(decode(url)).then(resolve).catch((e) => {
if (!retry)
return resolve(getUrlDecode(url, true));
reject(e);
});
}));

@@ -65,6 +68,6 @@ });

function fetchScript() {
return new Promise((resolve) => {
if (process.env.buildDev) {
return new Promise((resolve, reject) => {
if (process.env.buildDevDecoderPath) {
process.emitWarning('You are using a development build, the decoder will be use as local. If you want to use the internet decoder, please use a production build.');
return resolve(require(path_1.default.join(__dirname, '../../decode/build/decoder.js')));
return resolve(require(process.env.buildDevDecoderPath));
}

@@ -71,0 +74,0 @@ if (cache.has('decoder'))

@@ -444,3 +444,3 @@ "use strict";

function getYTIdFromText(text, precise = false) {
const reg = /https?:\/\/(?:music\.|www\.)?youtube\.com\/(?:watch\?v=|v\/|channel\/|playlist\?list=)([A-Za-z0-9_-]+)/m;
const reg = /https?:\/\/(?:music\.|www\.)?(?:youtube\.com\/(?:watch\?v=|v\/|channel\/|playlist\?list=)|youtu\.be\/)([A-Za-z0-9_-]+)/m;
let id = null;

@@ -447,0 +447,0 @@ if (!text.includes(' '))

{
"name": "ytmusic_api_unofficial",
"version": "2.0.6",
"version": "2.0.7",
"description": "A simple API to get music from YouTube Music",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc