init
This commit is contained in:
50
download_links.ps1
Normal file
50
download_links.ps1
Normal file
@@ -0,0 +1,50 @@
|
||||
# PowerShell script to read links from readme.md and download files
|
||||
# Usage: .\download_links.ps1
|
||||
|
||||
# Check if readme.md exists
|
||||
if (-not (Test-Path "readme.md")) {
|
||||
Write-Host "Error: readme.md file not found!" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Read file content
|
||||
$content = Get-Content "readme.md" -Raw
|
||||
|
||||
# Extract all https links
|
||||
Write-Host "Extracting links from readme.md..." -ForegroundColor Yellow
|
||||
$links = [regex]::Matches($content, 'https://[^\s]*') | ForEach-Object { $_.Value }
|
||||
|
||||
# Check if links were found
|
||||
if ($links.Count -eq 0) {
|
||||
Write-Host "Error: No links found in readme.md!" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Found links:" -ForegroundColor Green
|
||||
$links | ForEach-Object { Write-Host $_ }
|
||||
Write-Host ""
|
||||
|
||||
# Download each file
|
||||
$count = 0
|
||||
$index = 1
|
||||
foreach ($url in $links) {
|
||||
# Extract filename from URL and add index prefix to avoid conflicts
|
||||
$baseFilename = [System.IO.Path]::GetFileName($url)
|
||||
$filename = "$index-$baseFilename"
|
||||
|
||||
Write-Host "Downloading: $filename" -ForegroundColor Cyan
|
||||
|
||||
# Use Invoke-WebRequest to download file
|
||||
try {
|
||||
Invoke-WebRequest -Uri $url -OutFile $filename
|
||||
Write-Host "✓ Download successful: $filename" -ForegroundColor Green
|
||||
$count++
|
||||
} catch {
|
||||
Write-Host "✗ Download failed: $filename" -ForegroundColor Red
|
||||
Write-Host " Error: $($_.Exception.Message)" -ForegroundColor Red
|
||||
}
|
||||
$index++
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Download completed! Successfully downloaded $count files." -ForegroundColor Green
|
||||
44
download_links.sh
Normal file
44
download_links.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 脚本用于读取readme.md文件中的链接并下载文件
|
||||
# 使用方法: ./download_links.sh
|
||||
|
||||
# 检查readme.md文件是否存在
|
||||
if [ ! -f "readme.md" ]; then
|
||||
echo "错误: readme.md 文件不存在!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 提取所有https链接
|
||||
echo "正在从readme.md中提取链接..."
|
||||
links=$(grep -o 'https://[^ ]*' readme.md)
|
||||
|
||||
# 检查是否找到链接
|
||||
if [ -z "$links" ]; then
|
||||
echo "错误: 在readme.md中未找到任何链接!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "找到以下链接:"
|
||||
echo "$links"
|
||||
echo ""
|
||||
|
||||
# 下载每个文件
|
||||
count=0
|
||||
for url in $links; do
|
||||
# 从URL中提取文件名
|
||||
filename=$(basename "$url")
|
||||
|
||||
echo "正在下载: $filename"
|
||||
|
||||
# 使用curl下载文件
|
||||
if curl -s -o "$filename" "$url"; then
|
||||
echo "✓ 下载成功: $filename"
|
||||
count=$((count + 1))
|
||||
else
|
||||
echo "✗ 下载失败: $filename"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "下载完成! 成功下载了 $count 个文件。"
|
||||
7
readme.md
Normal file
7
readme.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Huibq音源加速链接:https://ghproxy.net/https://raw.githubusercontent.com/pdone/lx-music-source/main/huibq/latest.js
|
||||
|
||||
Flower音源加速链接:https://ghproxy.net/https://raw.githubusercontent.com/pdone/lx-music-source/main/flower/latest.js
|
||||
|
||||
Grass音源加速链接:https://tt.tenmeng.com/moonue/js/yecao202412.js
|
||||
|
||||
聚合API接口链接:https://api.music.lerd.dpdns.org/script.js
|
||||
89
source/Huibq_lxmusic音源.js
Normal file
89
source/Huibq_lxmusic音源.js
Normal file
@@ -0,0 +1,89 @@
|
||||
/*!
|
||||
* @name Huibq_lxmusic源
|
||||
* @description Github搜索“洛雪音乐音源”,反馈可前往GitHub提Issues或加入群组https://t.me/+Xh7BWUUPqUZlMDU1,禁止批量下载!
|
||||
* @version v1.2.0
|
||||
* @author Huibq
|
||||
*/
|
||||
const DEV_ENABLE = false
|
||||
const API_URL = 'https://render.niuma666bet.buzz'
|
||||
const API_KEY = 'share-v2'
|
||||
const MUSIC_QUALITY = {
|
||||
kw: ['128k', '320k'],
|
||||
kg: ['128k', '320k'],
|
||||
tx: ['128k', '320k'],
|
||||
wy: ['128k', '320k'],
|
||||
mg: ['128k', '320k'],
|
||||
}
|
||||
const MUSIC_SOURCE = Object.keys(MUSIC_QUALITY)
|
||||
const { EVENT_NAMES, request, on, send, utils, env, version } = globalThis.lx
|
||||
const httpFetch = (url, options = { method: 'GET' }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
request(url, options, (err, resp) => {
|
||||
if (err) return reject(err)
|
||||
resolve(resp)
|
||||
})
|
||||
})
|
||||
}
|
||||
const handleGetMusicUrl = async (source, musicInfo, quality) => {
|
||||
const songId = musicInfo.hash ?? musicInfo.songmid
|
||||
|
||||
const request = await httpFetch(`${API_URL}/url/${source}/${songId}/${quality}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': `${env ? `lx-music-${env}/${version}` : `lx-usic-request/${version}`}`,
|
||||
'X-Request-Key': API_KEY,
|
||||
},
|
||||
})
|
||||
const { body } = request
|
||||
if (!body || isNaN(Number(body.code))) throw new Error('unknow error')
|
||||
switch (body.code) {
|
||||
case 0:
|
||||
return body.url
|
||||
case 1:
|
||||
throw new Error('block ip')
|
||||
case 2:
|
||||
throw new Error('get music url failed')
|
||||
case 4:
|
||||
throw new Error('internal server error')
|
||||
case 5:
|
||||
throw new Error('too many requests')
|
||||
case 6:
|
||||
throw new Error('param error')
|
||||
default:
|
||||
throw new Error(body.msg ?? 'unknow error')
|
||||
}
|
||||
}
|
||||
const musicSources = {}
|
||||
MUSIC_SOURCE.forEach(item => {
|
||||
musicSources[item] = {
|
||||
name: item,
|
||||
type: 'music',
|
||||
actions: ['musicUrl'],
|
||||
qualitys: MUSIC_QUALITY[item],
|
||||
}
|
||||
})
|
||||
on(EVENT_NAMES.request, ({ action, source, info }) => {
|
||||
switch (action) {
|
||||
case 'musicUrl':
|
||||
if (env != 'mobile') {
|
||||
console.group(`Handle Action(musicUrl)`)
|
||||
console.log('source', source)
|
||||
console.log('quality', info.type)
|
||||
console.log('musicInfo', info.musicInfo)
|
||||
console.groupEnd()
|
||||
} else {
|
||||
console.log(`Handle Action(musicUrl)`)
|
||||
console.log('source', source)
|
||||
console.log('quality', info.type)
|
||||
console.log('musicInfo', info.musicInfo)
|
||||
}
|
||||
return handleGetMusicUrl(source, info.musicInfo, info.type)
|
||||
.then(data => Promise.resolve(data))
|
||||
.catch(err => Promise.reject(err))
|
||||
default:
|
||||
console.error(`action(${action}) not support`)
|
||||
return Promise.reject('action not support')
|
||||
}
|
||||
})
|
||||
send(EVENT_NAMES.inited, { status: true, openDevTools: DEV_ENABLE, sources: musicSources })
|
||||
17
source/[独家音源] v4.0.js
Normal file
17
source/[独家音源] v4.0.js
Normal file
File diff suppressed because one or more lines are too long
7
source/聚合API音源.js
Normal file
7
source/聚合API音源.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* @name 聚合API接口 (CF)
|
||||
* @description v3
|
||||
* @version 3
|
||||
* @author lerd
|
||||
*/
|
||||
let{stringify:t,parse:a}=JSON;let x=(r)=>{throw new Error(r)};let{EVENT_NAMES:n,request:b,on,send:y,version:v}=globalThis.lx;let A='https://api.music.lerd.dpdns.org';let h=(u,o={method:'GET'})=>new Promise((s,j)=>{b(u,o,(e,r)=>{if(e)return j(e);s(r)})});h(A+'/init.conf').then(r=>{if(r.body.code!==200)x("脚本初始化失败");let U=r.body.data;if(U.update.version>v)y(n.updateAlert,U.update);y(n.inited,U.init);}).catch(e=>x(e));on(n.request,async({action,source,info})=>{let r=await h(`${A}/${source}`,{method:'POST',body:t(info),headers:{'Content-Type':'application/json'}});let B=r.body;if(B.code===200)return B.data.url;else if(B.code===303){let S=a(t(B.data));let D=S.request;let F=S.response;try{let z=await h(encodeURI(D.url),D.options);if(F.check.key.reduce((a,c)=>a&&a[c],z)==F.check.value){let u=F.url.reduce((a,c)=>a&&a[c],z);if(u.startsWith("http"))return u;}}catch(e){x(e)}}else x(B.msg);});
|
||||
5
source/野花音源.js
Normal file
5
source/野花音源.js
Normal file
File diff suppressed because one or more lines are too long
5
source/野草音源.js
Normal file
5
source/野草音源.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user