{
"Injectscript": {
"reelmetadata": " javascript:(function(){
try{
let video=document.querySelector('video');
let username=document.querySelector('header a, span.x1lliihq')?.textContent||'';
let videoThumbnail=null;
if(video){
if(video.poster){
videoThumbnail=video.poster;
}else{
let container=video.closest('article, div.x1lliihq, div[role=\'presentation\'], div.x5yr21d');
if(container){
const imgs=container.querySelectorAll('img');
for(const img of imgs){
const src=img.src||'';
if(
img.width>100&&
img.height>100&&
!img.alt?.includes('profile picture')&&
!src.includes('svg')&&
!src.includes('profile')&&
!src.includes('emoji')
){
videoThumbnail=src;
break;
}
}
}
if(!videoThumbnail){
const meta=document.querySelector('meta[property=\'og:image\']');
if(meta)videoThumbnail=meta.content;
}
}
}
const likesText=document.querySelector('a[href*=\'/liked_by/\'] span')?.textContent||'';
const likes=likesText.replace(/[^0-9]/g,'');
const data={
username:username,
videoThumbnail:videoThumbnail,
likes:likes
};
if(window.AndroidExtractor&&AndroidExtractor.onContentExtracted){
AndroidExtractor.onContentExtracted(JSON.stringify(data));
}else{
}
}catch(err){
}
})();
", "insta":"
(() => {
if (window.__IG_CDN_LOADER__) {
console.alert('IG CDN loader already running. Call window.__IG_CDN_LOADER__.stop() to stop.');
return;
}
console.clear();
console.log('[CDN] 1. starting');
const state = {
candidates: new Map(),
running: true,
lastResultCount: 0,
};
const IG_VIDEO_REGEX = /https?:\/\/([a-z0-9.-]+)?(cdninstagram\.com|fbcdn\.net|akamaihd\.net)[^\s'']+\.(mp4|m4a|m3u8|mpd)(\?.*)?$/i;
function cleanUrl(url) {
if (!url) return url;
return url
.replace(/([&?])bytestart=\d+(&|$)/g, '$1')
.replace(/([&?])byteend=\d+(&|$)/g, '$1')
.replace(/[&?]($)/, '')
.replace(/&&+/g, '&')
.replace(/\?&/, '?')
.replace(/[&?]$/, '');
}
function addCandidate(url) {
if (!url) return;
const cleaned = cleanUrl(url);
if (!IG_VIDEO_REGEX.test(cleaned)) return;
if (!state.candidates.has(cleaned)) {
state.candidates.set(cleaned, { seenAt: Date.now() });
console.log('[CDN] candidate:', cleaned);
}
}
const origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function (...args) {
try {
const url = args[1];
if (typeof url === 'string' && IG_VIDEO_REGEX.test(url)) addCandidate(url);
this._ig_url = url;
} catch { }
return origOpen.apply(this, args);
};
const origSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function (...args) {
try {
this.addEventListener('load', function () {
try {
const url = this._ig_url || this.responseURL || '';
if (IG_VIDEO_REGEX.test(url)) addCandidate(url);
} catch { }
});
} catch { }
return origSend.apply(this, args);
};
const origFetch = window.fetch.bind(window);
window.fetch = async function (...args) {
try {
const req = args[0];
const url = typeof req === 'string' ? req : req?.url;
if (url && IG_VIDEO_REGEX.test(url)) addCandidate(url);
const res = await origFetch(...args);
try {
const resUrl = res.url || (typeof req === 'string' ? req : '');
if (resUrl && IG_VIDEO_REGEX.test(resUrl)) addCandidate(resUrl);
} catch { }
return res;
} catch {
return origFetch(...args);
}
};
const observer = new MutationObserver(muts => {
muts.forEach(m => {
if (m.type === 'attributes' && m.attributeName === 'src') {
const el = m.target;
if (el.tagName?.toLowerCase() === 'video' && IG_VIDEO_REGEX.test(el.src)) {
addCandidate(el.src);
}
}
});
});
new MutationObserver(() => {
document.querySelectorAll('video').forEach(v => {
observer.observe(v, { attributes: true, attributeFilter: ['src'] });
});
}).observe(document.body, { childList: true, subtree: true });
document.querySelectorAll('video').forEach(v => observer.observe(v, { attributes: true, attributeFilter: ['src'] }));
function exportCollectedUrls() {
return Array.from(state.candidates.keys());
}
function stop() {
state.running = false;
XMLHttpRequest.prototype.open = origOpen;
XMLHttpRequest.prototype.send = origSend;
window.fetch = origFetch;
observer.disconnect();
console.log('[CDN] stopped.');
}
window.__IG_CDN_LOADER__ = { exportCollectedUrls, stop, state };
function extractQuality(url) {
const lower = url.toLowerCase();
const match = lower.match(/q(\d{2})/);
if (match) return match[0];
if (lower.includes('1080')) return 'q90';
if (lower.includes('720')) return 'q60';
if (lower.includes('480')) return 'q40';
return 'unknown';
}
async function getMediaInfo(url) {
try {
const res = await fetch(url, { headers: { Range: 'bytes=0-3000000' } });
const blob = await res.blob();
const video = document.createElement('video');
video.src = URL.createObjectURL(blob);
return await new Promise(resolve => {
video.onloadedmetadata = () => {
const hasVideo = video.videoWidth > 0 && video.videoHeight > 0;
const kind = hasVideo ? 'video' : 'audio';
const info = {
url,
kind: hasVideo ? 'video' : 'audio',
duration: parseFloat(video.duration.toFixed(2)),
sizeMB: parseFloat((blob.size / (1024 * 1024)).toFixed(2)),
mime: hasVideo ? blob.type : 'audio/mp4'
};
if (hasVideo) {
info.resolution = `${video.videoWidth}x${video.videoHeight}`;
info.quality = extractQuality(url);
}
resolve(info);
};
video.onerror = () =>
resolve({ url, kind: 'unknown', error: 'metadata_error' });
});
} catch (e) {
return { url, kind: 'error', error: e.message };
}
}
function groupAndPair(mediaList) {
const videos = mediaList.filter(m => m.kind === 'video');
const audios = mediaList.filter(m => m.kind === 'audio');
const groups = [];
for (const v of videos) {
const existing = groups.find(g => Math.abs(g.duration - v.duration) < 0.3);
if (existing) existing.videos.push(v);
else groups.push({ duration: v.duration, videos: [v], audios: [] });
}
for (const a of audios) {
const match = groups.find(g => Math.abs(g.duration - a.duration) < 0.3);
if (match) match.audios.push(a);
}
for (const g of groups) {
g.videos.sort((a, b) => {
const qa = parseInt(a.quality?.replace('q', '')) || 0;
const qb = parseInt(b.quality?.replace('q', '')) || 0;
return qa - qb;
});
}
return groups;
}
function transformGroupedJson(grouped) {
const allVideos = [];
grouped.forEach(group => {
let bestVideo = null;
if (group.videos?.length) {
bestVideo = group.videos.reduce((best, curr) => {
const [cw, ch] = (curr.resolution || '0x0').split('x').map(Number);
const [bw, bh] = (best.resolution || '0x0').split('x').map(Number);
const currRes = cw * ch;
const bestRes = bw * bh;
if (currRes > bestRes) return curr;
if (currRes === bestRes && curr.sizeMB > best.sizeMB) return curr;
return best;
}, group.videos[0]);
}
const audio = group.audios?.[0];
if (bestVideo && audio) {
bestVideo.audiourl = audio.url;
bestVideo.audio_kind = audio.kind;
bestVideo.audio_duration = audio.duration;
bestVideo.audio_sizeMB = audio.sizeMB;
bestVideo.audio_mime = audio.mime;
}
if (bestVideo) {
allVideos.push(bestVideo);
}
});
return { videos: allVideos };
}
let analyzeDone = false;
async function autoAnalyzeLoop() {
if (analyzeDone) return;
if (!window.__IG_CDN_LOADER__) return;
const urls = window.__IG_CDN_LOADER__.exportCollectedUrls();
if (urls.length === window.__IG_CDN_LOADER__.state.lastResultCount) return;
window.__IG_CDN_LOADER__.state.lastResultCount = urls.length;
console.log(`[Analyzer] Fetching metadata ${urls.length}. `);
const results = [];
for (const url of urls) {
const info = await getMediaInfo(url);
results.push(info);
}
const grouped = groupAndPair(results);
const cleaned = transformGroupedJson(grouped);
console.log(JSON.stringify(cleaned, null, 2));
Android.RECEIVE_LINKS(JSON.stringify(cleaned));
window.__IG_CDN_LOADER__.stop();
analyzeDone = true;
}
setInterval(autoAnalyzeLoop, 400);
})();
",
"fdown_net": "javascript: (function () {
try {
let attemptTry = 0;
const maxAttempts = 10;
const interval = 400;
const Scanninglink = function () {
Android.logWebStatus('Step 4: Starting search for downloading (Links)');
attemptTry++;
Android.logWebStatus('Step [4.1]: Attempt ' + attemptTry + ' to find download links');
let arrayList = [];
const hdLink = document.getElementById('hdlink');
const sdLink = document.getElementById('sdlink');
if (sdLink && sdLink.href) {
arrayList.push(sdLink.href);
Android.logWebStatus('Step [4.2]: Found SD link (2nd link): ' + sdLink.href);
Android.RECEIVE_LINKS(JSON.stringify(arrayList));
Android.logWebStatus('Step [5]: Link sent: ' + arrayList[0]);
return;
} else if (hdLink && hdLink.href) {
arrayList.push(hdLink.href);
Android.logWebStatus('Step [4.3]: Only HD link found: ' + hdLink.href);
Android.RECEIVE_LINKS(JSON.stringify(arrayList));
Android.logWebStatus('Step [5]: Link sent: ' + arrayList[0]);
return;
}
if (attemptTry < maxAttempts) {
Android.logWebStatus('Step [4.4]: No links found, retrying...');
setTimeout(Scanninglink, interval);
return;
} else {
Android.logWebStatus('Step [6]: No download links found after ' + maxAttempts + ' attempts');
Android.LogErrorT('fdown_net -> No download links found');
}
};
if (window.location.href.endsWith('download.php')) {
Scanninglink();
return;
}
let CLick_attempt = 0;
let CSearching_attempt = 0;
const smaxAttempts = 20;
const sinterval = 200;
let submitClicked = false;
function tryClickSubmit() {
submitClicked = true;
CLick_attempt++;
CSearching_attempt++;
const submitBtn = document.getElementsByClassName('btn btn-primary input-lg')[0];
Android.logWebStatus(`Step 3: Searching Submit Button !!!`);
if (submitBtn) {
submitBtn.click();
submitClicked = true;
Android.logWebStatus(`Step 3.1: Submit Clicked = on attempt ${CLick_attempt}`);
} else if (CLick_attempt < smaxAttempts) {
setTimeout(tryClickSubmit, sinterval);
Android.logWebStatus(`Step 3.2: Submit Button NOT* Found (${CSearching_attempt}/${smaxAttempts}`);
} else {
Android.logWebStatus('Submit button not found after maximum attempts.');
}
}
Android.logWebStatus('Step 1: Starting script execution');
let iattempts = 0;
const imaxAttempts = 20;
const iinterval = 200;
function trySetInput() {
iattempts++;
const input = document.getElementsByName('URLz')[0];
if (input) {
input.value = '__LINK__';
input.dispatchEvent(new Event('input', {bubbles: true }));
Android.logWebStatus(`Step 2: Input value set (attempt ${iattempts})`);
setTimeout(() => {
tryClickSubmit();
}, 2309);
return;
} else if (iattempts < imaxAttempts) {
setTimeout(trySetInput, iinterval);
} else {
Android.LogErrorT('fdown_net -> Input field not found after retries');
}
}
trySetInput();
} catch (e) {
Android.LogErrorT(e.message);
}
})();
"
},"onCore": {
"other": "no4",
"onWeb": {
"webresourceblock": "on"
}
}
}
Comments
Post a Comment