fixed url gen on user-upped tracks

This commit is contained in:
uh wot 2021-08-02 20:27:42 +02:00
parent 30153cfb8a
commit ada8193533
Signed by: uhwot
GPG Key ID: CB2454984587B781
3 changed files with 5 additions and 5 deletions

4
dist/worker.js vendored

File diff suppressed because one or more lines are too long

View File

@ -207,7 +207,7 @@ function track_url(json, format, url_func) {
format = format_string_to_num[format] format = format_string_to_num[format]
return url_func(md5_origin, format, id, media_version) return url_func(md5_origin, format, id.toString(), media_version)
} }
async function m3u8(type, id, format, access_token, tagging) { async function m3u8(type, id, format, access_token, tagging) {

View File

@ -39,14 +39,14 @@ impl Cipher {
} }
#[wasm_bindgen] #[wasm_bindgen]
pub fn stream_url(md5_origin: &str, format: &str, id: i32, media_version: u8) -> String { pub fn stream_url(md5_origin: &str, format: &str, id: &str, media_version: u8) -> String {
// md5 origin + format num + id + media version // md5 origin + format num + id + media version
let metadata = [ let metadata = [
md5_origin.as_bytes(), md5_origin.as_bytes(),
&[b'\xa4'], &[b'\xa4'],
format.as_bytes(), format.as_bytes(),
&[b'\xa4'], &[b'\xa4'],
id.to_string().as_bytes(), id.as_bytes(),
&[b'\xa4'], &[b'\xa4'],
media_version.to_string().as_bytes(), media_version.to_string().as_bytes(),
].concat(); ].concat();