playdl-music-extractor
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "playdl-music-extractor", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "PlayDL Music Extractor is a Extractor/Scrapper and Helps Players to fetch data from play-dl or Custom Extractors , as Per reduces extra work and credentials", | ||
@@ -27,11 +27,11 @@ "main": "./src/index.js", | ||
"docs": "jsdoc node_modules/.bin/jsdoc --configure .jsdoc.json --verbose", | ||
"test": "node test/workaround.js" | ||
"test": "node .test/workaround.js" | ||
}, | ||
"devDependencies": { | ||
"@babel/eslint-parser": "^7.17.0", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/eslint-parser": "^7.18.2", | ||
"@babel/preset-env": "^7.18.2", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.10.0", | ||
"eslint": "^8.17.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-import": "^2.26.0", | ||
"jsdoc": "^3.6.10", | ||
@@ -41,3 +41,3 @@ "jsdoc-babel": "^0.5.0", | ||
"nyc": "^15.1.0", | ||
"semantic-release": "^19.0.2" | ||
"semantic-release": "^19.0.3" | ||
}, | ||
@@ -71,7 +71,8 @@ "config": { | ||
"@sidislive/soundcloud-scraper": "^1.0.1", | ||
"axios": "^0.26.1", | ||
"axios": "^0.27.2", | ||
"ffmpeg-static": "^5.0.0", | ||
"is-url": "^1.2.4", | ||
"isomorphic-unfetch": "^3.1.0", | ||
"lyrics-finder": "^21.7.0", | ||
"play-dl": "^1.8.9", | ||
"play-dl": "^1.9.5", | ||
"prism-media": "^1.3.2", | ||
@@ -81,3 +82,3 @@ "proxies-generator": "^1.0.6", | ||
"reverbnation-scraper": "^2.0.0", | ||
"spotify-url-info": "^2.2.7" | ||
"spotify-url-info": "^3.1.2" | ||
}, | ||
@@ -84,0 +85,0 @@ "directories": { |
@@ -154,5 +154,5 @@ <div align="center"> | ||
- **new playdl.streamExtractor()** | **playdlQuick.streamExtractor()** | ||
- **new playdl.softExtractor()** | **playdlQuick.softExtractor()** | ||
- **new playdl.exec()** | **playdlQuick.exec()** | ||
- **new playdl.streamExtractor()** OR **playdlQuick.streamExtractor()** | ||
- **new playdl.softExtractor()** OR **playdlQuick.softExtractor()** | ||
- **new playdl.exec()** OR **playdlQuick.exec()** | ||
@@ -159,0 +159,0 @@ ##### Option's Scheme : |
@@ -66,2 +66,3 @@ const { | ||
} | ||
__searchResults = ( | ||
@@ -134,5 +135,3 @@ await playdlEngine.#__customSearch( | ||
__validateResults[1] = __validate | ||
? __validate?.slice(3, __validate?.length) | ||
: undefined; | ||
__validateResults[1] = __validate ? __validate?.split('_')?.[1] : undefined; | ||
switch (__validateResults[0]) { | ||
@@ -188,3 +187,4 @@ case 'youtube': | ||
__videoDetails = (await video_info(__rawResults[0]?.url))?.video_details; | ||
__videoDetails = (await video_info(__rawResults[0]?.url)) | ||
?.video_details; | ||
return __videoDetails ? [__videoDetails] : __rawResults[0]; | ||
@@ -191,0 +191,0 @@ } |
@@ -1,2 +0,3 @@ | ||
const { getData, getPreview } = require('spotify-url-info'); | ||
const fetch = require('isomorphic-unfetch'); | ||
const { getData, getPreview } = require('spotify-url-info')(fetch); | ||
const { setToken } = require('play-dl'); | ||
@@ -18,9 +19,7 @@ const playdlEngine = require('./__playdlEngine'); | ||
return returnRegexValue | ||
&& Boolean(spotify.__spotifyRegex.find((regExp) => regExp.test(rawUrl))) | ||
&& Boolean(spotify.__spotifyRegex.find((regExp) => regExp.test(rawUrl))) | ||
? rawUrl?.match( | ||
spotify.__spotifyRegex.find((regExp) => rawUrl.match(regExp)), | ||
) ?? false | ||
: Boolean( | ||
spotify.__spotifyRegex.find((regExp) => regExp.test(rawUrl)), | ||
); | ||
spotify.__spotifyRegex.find((regExp) => rawUrl.match(regExp)), | ||
) ?? false | ||
: Boolean(spotify.__spotifyRegex.find((regExp) => regExp.test(rawUrl))); | ||
} catch { | ||
@@ -79,24 +78,24 @@ return false; | ||
const __processedTracks = ( | ||
await Promise.all( | ||
__arryData?.map(async (rawTrack) => { | ||
if ( | ||
!rawTrack | ||
|| (__cacheCount | ||
&& __cacheCount >= __scrapperOptions?.fetchOptions?.fetchLimit) | ||
) return undefined; | ||
__cacheGarbage = await spotify.__trackParser( | ||
rawTrack, | ||
++__cacheCount, | ||
__scrapperOptions, | ||
__cacheMain, | ||
); | ||
return __cacheGarbage?.[0]; | ||
}), | ||
) | ||
)?.filter(Boolean) ?? []; | ||
await Promise.all( | ||
__arryData?.map(async (rawTrack) => { | ||
if ( | ||
!rawTrack | ||
|| (__cacheCount | ||
&& __cacheCount >= __scrapperOptions?.fetchOptions?.fetchLimit) | ||
) return undefined; | ||
__cacheGarbage = await spotify.__trackParser( | ||
rawTrack, | ||
++__cacheCount, | ||
__scrapperOptions, | ||
__cacheMain, | ||
); | ||
return __cacheGarbage?.[0]; | ||
}), | ||
) | ||
)?.filter(Boolean) ?? []; | ||
return { | ||
playlist: Boolean( | ||
__rawData?.tracks?.items | ||
&& Array.isArray(__rawData?.tracks?.items) | ||
&& __rawData?.tracks?.items?.length > 0, | ||
&& Array.isArray(__rawData?.tracks?.items) | ||
&& __rawData?.tracks?.items?.length > 0, | ||
), | ||
@@ -159,4 +158,4 @@ tracks: __processedTracks, | ||
? `https://open.spotify.com/track/${ | ||
rawTrack?.id ?? rawTrack?.track?.id | ||
}` | ||
rawTrack?.id ?? rawTrack?.track?.id | ||
}` | ||
: undefined), | ||
@@ -163,0 +162,0 @@ ); |
@@ -23,3 +23,6 @@ const { stream, setToken, search } = require('play-dl'); | ||
this.description = rawBlueprint?.description; | ||
this.author = { name: rawBlueprint?.author, url: rawBlueprint?.author_link }; | ||
this.author = { | ||
name: rawBlueprint?.author, | ||
url: rawBlueprint?.author_link, | ||
}; | ||
this.extractorModel = { | ||
@@ -26,0 +29,0 @@ orignal: rawBlueprint?.orignal_extractor ?? 'Unknown', |
@@ -37,3 +37,3 @@ const uriCheck = require('is-url'); | ||
rawQuery, | ||
undefined, | ||
{ orignal_extractor: 'youtube' }, | ||
__scrapperOptions, | ||
@@ -40,0 +40,0 @@ __cacheMain, |
@@ -19,18 +19,2 @@ const path = require('path'); | ||
/** | ||
* @constructor | ||
* @param {scrapperOptions} __scrapperOptions -> Scrapping Options for functions and base Source Engine | ||
*/ | ||
constructor(__scrapperOptions = playdl.#__privateCaches.__scrapperOptions) { | ||
super(); | ||
this.__scrapperOptions = { | ||
...playdl.#__privateCaches.__scrapperOptions, | ||
...__scrapperOptions, | ||
fetchOptions: { | ||
...playdl.#__privateCaches?.fetchOptions, | ||
...__scrapperOptions?.fetchOptions, | ||
}, | ||
}; | ||
} | ||
/** | ||
* @static | ||
@@ -65,2 +49,18 @@ * @private | ||
/** | ||
* @constructor | ||
* @param {scrapperOptions} __scrapperOptions -> Scrapping Options for functions and base Source Engine | ||
*/ | ||
constructor(__scrapperOptions = playdl.#__privateCaches.__scrapperOptions) { | ||
super(); | ||
this.__scrapperOptions = { | ||
...playdl.#__privateCaches.__scrapperOptions, | ||
...__scrapperOptions, | ||
fetchOptions: { | ||
...playdl.#__privateCaches?.fetchOptions, | ||
...__scrapperOptions?.fetchOptions, | ||
}, | ||
}; | ||
} | ||
/** | ||
* exec() -> Raw and in-built function for fetching Data for other methods with no exceptions | ||
@@ -88,3 +88,3 @@ * @param {string} rawQuery -> A String Value for Song Name or Url to be Parsed and Fetch Data about it | ||
throw new Error( | ||
'playdl-music-playdl Error : Invalid Query is Provided to Parse and Stream for Client', | ||
'playdl-music-extractor Error : Invalid Query is Provided to Parse and Stream for Client', | ||
); | ||
@@ -97,3 +97,9 @@ } | ||
if (facebook.__test(rawQuery)) return await facebook.__extractor(rawQuery, __scrapperOptions, this); | ||
if (reverbnation.__test(rawQuery)) return await reverbnation.__extractor(rawQuery, __scrapperOptions, this); | ||
if (reverbnation.__test(rawQuery)) { | ||
return await reverbnation.__extractor( | ||
rawQuery, | ||
__scrapperOptions, | ||
this, | ||
); | ||
} | ||
if (deezer.__test(rawQuery)) return await deezer.__extractor(rawQuery, __scrapperOptions, this); | ||
@@ -103,3 +109,3 @@ if (youtube.__test(rawQuery)) return await youtube.__extractor(rawQuery, __scrapperOptions, this); | ||
throw new Error( | ||
'playdl-music-playdl Error : Un-Supportable Query is Provided to Parse and Stream for Client', | ||
'playdl-music-extractor Error : Un-Supportable Query is Provided to Parse and Stream for Client', | ||
); | ||
@@ -106,0 +112,0 @@ } catch (rawError) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
64171
1485
12
+ Addedisomorphic-unfetch@^3.1.0
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@0.27.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedisomorphic-unfetch@3.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedspotify-uri@4.1.0(transitive)
+ Addedspotify-url-info@3.2.18(transitive)
+ Addedunfetch@4.2.0(transitive)
- Removedaxios@0.26.1(transitive)
- Removedcross-fetch@3.1.8(transitive)
- Removedspotify-uri@2.2.2(transitive)
- Removedspotify-url-info@2.2.9(transitive)
Updatedaxios@^0.27.2
Updatedplay-dl@^1.9.5
Updatedspotify-url-info@^3.1.2