Incude vkvideo extractor #445
Labels
No labels
MediaFlow Proxy
autorelease: pending
autorelease: tagged
bug
documentation
duplicate
enhancement
help wanted
invalid
question
wontfix
🇩🇪 German
🇫🇷 French
🇮🇳 Indian
🇸🇦 Arabic
🌐 Multi
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Creepso/webstreamr-github#445
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi
There is a vkvideo extractor here
https://github.com/Gujal00/ResolveURL/blob/master/script.module.resolveurl/lib/resolveurl/plugins/vk.py
Can you add?
This website main server source is vkvideo
Movie
The link is like this
https://vkvideo.ru/video_ext.php?oid=319533096&id=456239326&hash=c25be5174fb15ba2
I asked the author and his extractor is working well on that link
I failed to convert it to typescript
I tried to convert but I get
"You were rate-limited" error
import { Context, Meta, UrlResult, Format } from '../types';
import { Extractor } from './Extractor';
import { guessHeightFromPlaylist } from '../utils/height';
import { NotFoundError } from '../error';
export class VKResolver extends Extractor {
public readonly id = 'vk';
public readonly label = 'VK';
public override readonly ttl = 10800000; // 3 hours
private domains = ['vk.com', 'vkvideo.ru'];
public supports(_ctx: Context, url: URL): boolean {
//// _ctx is deliberately kept to satisfy the signature
return this.domains.includes(url.host);
}
protected async extractInternal(ctx: Context, url: URL, meta: Meta): Promise<UrlResult[]> {
const query = new URLSearchParams(url.search);
const oid = query.get('oid');
const videoId = query.get('id');
// const hash = query.get('hash'); // unused, removed
const videoList = query.get('list') ?? '';
postData.set('act', 'show');
postData.set('al', '1');
postData.set('video',
${oid}_${videoId});if (videoList) {
postData.set('list', videoList);
postData.set('load_playlist', '1');
postData.set('module', 'direct');
postData.set('show_next', '1');
postData.set('playlist_id',
${oid}_-2);}
}
}
I get this error on the post
Got 429 (Too Many Requests) for https://vkvideo.ru/al_video.php?act=showOk so I've advanced with this and the mediaflow proxy is needed.
The problem is that the mediaflow proxy needs some edits to be able to hande this provider...
Master is like this
https://vkvd591.okcdn.ru/?srcIp=185.187.0.130&pr=40&expires=1765235190685&srcAg=CHROME&fromCache=1&ch=1336333768&ms=185.226.53.179&type=1&sig=_2cGGKog4c8&ct=6&urls=185.226.55.233&clientType=13&appId=512000384397&zs=43&id=9464193092136Is has inside
#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1136890,AVERAGE-BANDWIDTH=531299,QUALITY=sd,FRAME-RATE=24,RESOLUTION=852x354 /expires/1765236727874/srcIp/185.187.0.130/pr/40/srcAg/CHROME/ch/1676822812/ms/185.226.53.179/mid/10754960730152/type/2/sig/ZhcTk-IMrqM/ct/8/urls/185.226.52.167/clientType/13/zs/43/id/9464193092136/video/ #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=485431,AVERAGE-BANDWIDTH=266838,QUALITY=lowest,FRAME-RATE=24,RESOLUTION=426x178 /expires/1765236727874/srcIp/185.187.0.130/pr/40/srcAg/CHROME/ch/1676822812/ms/185.226.53.179/mid/10754960730152/type/0/sig/Jj4sQQ5oFBQ/ct/8/urls/185.226.52.167/clientType/13/zs/43/id/9464193092136/video/ #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=836641,AVERAGE-BANDWIDTH=393641,QUALITY=low,FRAME-RATE=24,RESOLUTION=640x266 /expires/1765236727874/srcIp/185.187.0.130/pr/40/srcAg/CHROME/ch/1676822812/ms/185.226.53.179/mid/10754960730152/type/1/sig/gWhVpAhPxyY/ct/8/urls/185.226.52.167/clientType/13/zs/43/id/9464193092136/video/ #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2275783,AVERAGE-BANDWIDTH=983384,QUALITY=hd,FRAME-RATE=24,RESOLUTION=1280x532 /expires/1765236727874/srcIp/185.187.0.130/pr/40/srcAg/CHROME/ch/1676822812/ms/185.226.53.179/mid/10754960730152/type/3/sig/GX4o1yHSKgg/ct/8/urls/185.226.52.167/clientType/13/zs/43/id/9464193092136/video/ #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=337936,AVERAGE-BANDWIDTH=201553,QUALITY=mobile,FRAME-RATE=24,RESOLUTION=256x106 /expires/1765236727874/srcIp/185.187.0.130/pr/40/srcAg/CHROME/ch/1676822812/ms/185.226.53.179/mid/10754960730152/type/4/sig/o5cX1H6wE4k/ct/8/urls/185.226.52.167/clientType/13/zs/43/id/9464193092136/video/In reality segments become
https://vkvd591.okcdn.ru/?expires=...&bytes=0-12987So its a mix between hls and mpd mp4 with segments which are added with byte ranges
The mediaflow needs rewrite un support it natively but this takes time to do it and for the moment I will leave it as to much hasle + at the end might be playable only on same IP as the requestor like vidguard.
Lets keep it open to not forgot it.
I'm really close with this but I don't know why the mediaflow gets the full mp4 file which stremio fails to play and gets timeout
For ex full mp4 file
https://vk6-9.vkuser.net/?srcIp=xxxxxxxxx&pr=40&expires=1765315293688&srcAg=CHROME&fromCache=1&ch=1336333768&ms=95.142.206.168&type=1&sig=LQf4pduodWU&ct=6&urls=45.136.22.202%3B185.226.52.166&clientType=13&appId=512000384397&zs=43&id=9576010484237Instead should get ranges
Segment ranges
https://vk6-9.vkuser.net/?expires=1765314411759&srcIp=xxxxxx&pr=40&srcAg=CHROME&ms=xxxxxxxx&type=2&sig=Fct7_gaCQNc&ct=11&urls=45.136.22.202%3B185.226.52.166&clientType=13&zs=43&id=9576010484237&bytes=0-11811We should also make this work as now I see that this provider offers videos till 4K.
On my last attempt I had difficultes because the provider hosts MPD and MP4 but I failed to make it work through mediaflow...
Hey I need your help here
I have this code which now doesnt give rate limit...I get a result(best quality) but is not playable
I can't check what is the final url that being returned because is not showing in the logs
Using curl the link returned is something like this and it work on vlc. Does stremio can play this? And what might be wrong? The links work everywhere so are not ip locked
Master
https://vkvd289.okcdn.ru/video.m3u8?cmd=videoPlayerCdn&expires=1765623902829&srcIp=xxxxxxxxx&pr=40&srcAg=UNKNOWN&ch=1676822812&ms=185.226.52.167&mid=10754960730152&type=2&sig=aCqDNSyEkHE&ct=8&urls=185.226.53.179&clientType=13&zs=43&id=9464193092136&m3u8Inside
#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1136890,AVERAGE-BANDWIDTH=531299,QUALITY=sd,FRAME-RATE=24,RESOLUTION=852x354 /expires/1765623902829/srcIp/xxxxxxxx/pr/40/srcAg/UNKNOWN/ch/1676822812/ms/185.226.52.167/mid/10754960730152/type/2/sig/aCqDNSyEkHE/ct/8/urls/185.226.53.179/clientType/13/zs/43/id/9464193092136/video/ #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=485431,AVERAGE-BANDWIDTH=266838,QUALITY=lowest,FRAME-RATE=24,RESOLUTION=426x178 /expires/1765623902829/srcIp/xxxxxxxxx/pr/40/srcAg/UNKNOWN/ch/1676822812/ms/185.226.52.167/mid/10754960730152/type/0/sig/xrMD4tbFTz8/ct/8/urls/185.226.53.179/clientType/13/zs/43/id/9464193092136/video/ #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=836641,AVERAGE-BANDWIDTH=393641,QUALITY=low,FRAME-RATE=24,RESOLUTION=640x266 /expires/1765623902829/srcIp/xxxxxxxx/pr/40/srcAg/UNKNOWN/ch/1676822812/ms/185.226.52.167/mid/10754960730152/type/1/sig/a6mMfqkJ7ZY/ct/8/urls/185.226.53.179/clientType/13/zs/43/id/9464193092136/video/ #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2275783,AVERAGE-BANDWIDTH=983384,QUALITY=hd,FRAME-RATE=24,RESOLUTION=1280x532 /expires/1765623902829/srcIp/xxxxxxxc/pr/40/srcAg/UNKNOWN/ch/1676822812/ms/185.226.52.167/mid/10754960730152/type/3/sig/T8N9bXspsWc/ct/8/urls/185.226.53.179/clientType/13/zs/43/id/9464193092136/video/ #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=337936,AVERAGE-BANDWIDTH=201553,QUALITY=mobile,FRAME-RATE=24,RESOLUTION=256x106 /expires/1765623902829/srcIp/xxxxxxx/pr/40/srcAg/UNKNOWN/ch/1676822812/ms/185.226.52.167/mid/10754960730152/type/4/sig/emQkM4xuDpg/ct/8/urls/185.226.53.179/clientType/13/zs/43/id/9464193092136/video/`import { Context, Meta, UrlResult, Format } from '../types';
import { Extractor } from './Extractor';
import { guessHeightFromPlaylist } from '../utils/height';
import { NotFoundError } from '../error';
export class VKResolver extends Extractor {
public readonly id = 'vk';
public readonly label = 'VK';
public override readonly ttl = 10800000; // 3 hours
private domains = ['vk.com', 'vkvideo.ru'];
public supports(_: Context, url: URL): boolean {
return this.domains.includes(url.host);
}
protected async extractInternal(
ctx: Context,
url: URL,
meta: Meta
): Promise<UrlResult[]> {
url: new URL(value + '.m3u8'),
format: Format.hls,
label:
VK ${height ?? 'auto'}p,sourceId: this.id,
ttl: this.ttl,
meta: { ...meta, height },
requestHeaders: {
Referer:
https://${url.host}/,},
});
}
}
`
You can run it yourself
curl 'https://vkvideo.ru/al_video.php?act=show'
-X POST
-H 'User-Agent: Mozilla/5.0'
-H 'Referer: https://vkvideo.ru/'
-H 'Origin: https://vkvideo.ru'
-H 'X-Requested-With: XMLHttpRequest'
--data 'act=show&al=1&video=319533096_456239475' \ > response.json
Than
iconv -f utf-8 -t utf-8 response.json | sed 's/\\u0000//g'I think is not possible even using mediaflow because of srcAg=CHROME
Is bounded with the request
The only way maybe this can work is via mpd
I'm near but I don't get it what I'm f up...Those links generated from curl are working everywhere without mediaflow...
https://github.com/mhdzumair/mediaflow-proxy/pull/191
curl -s -X POST "https://vkvideo.ru/al_video.php?act=show" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -H "Referer: https://vkvideo.ru/" -H "Origin: https://vkvideo.ru" -H "X-Requested-With: XMLHttpRequest" --data "act=show&al=1&video=319533096_456239517" | sed 's/^<!--//' | jq ' .payload[] | select(type=="array") | .[] | select(type=="object" and has("player")) | .player.params[0] | { url144, url240, url360, url480, url720, hls, hls_fmp4, dash_sep } 'I found to make it work directly without mediaflow support...The problem was the headers flow
Sorry I saw the ping just now