v0.2.1 (#53)
* ios proxy app, tune vp8 tunnel * refactor go modules, move headless joiner android to a go captcha * restore emojis in vk bot keyboard * headless support in vk bot * remove telemost dc hooks, update cretor-app ui and bot * remove telemost support from go code, add fallback to video if mode == dc in joiners * fix headless creators in windows * update vk call creation autoclick * force desktop useragent for creator app * kick disconnected user in headless vk creator immediately when connection is lost * update README.md * update SETUP.md * update release version * add fallback for link creation in vk bot
This commit is contained in:
1 parent
9e1f2a98d9
commit
1b2d6bc5d3
89 files changed
+3503
-2158
No files matched your search
@@ -3,7 +3,7 @@
|
||||
window.__callCreatorStarted = true;
|
||||
|
||||
var CALL_MENU_TRIGGER_ID = 'call-menu-trigger';
|
||||
var CREATE_CALL_TEXT = 'Создать звонок по';
|
||||
var CALL_MENU_ID = 'call-menu';
|
||||
var CALL_IN_PROGRESS_KEY = 'call_in_progress';
|
||||
var VK_CALL_BASE = 'https://vk.com/call/join/';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
var observer = new MutationObserver(function() {
|
||||
if (fn()) observer.disconnect();
|
||||
});
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
observer.observe(document.documentElement, { childList: true, subtree: true });
|
||||
};
|
||||
|
||||
waitAndClick(function() {
|
||||
@@ -26,20 +26,20 @@
|
||||
console.log("[BOT] VKCalls: opened call menu");
|
||||
|
||||
waitAndClick(function() {
|
||||
var spans = document.querySelectorAll('span');
|
||||
var el = null;
|
||||
for (var i = 0; i < spans.length; i++) {
|
||||
if (spans[i].textContent.indexOf(CREATE_CALL_TEXT) !== -1) {
|
||||
el = spans[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
var btn = el ? (el.closest('button') || el.closest('div')) : null;
|
||||
var menu = document.getElementById(CALL_MENU_ID);
|
||||
var btn = menu ? menu.querySelector('button') : null;
|
||||
if (!btn) return false;
|
||||
|
||||
btn.click();
|
||||
console.log("[BOT] VKCalls: created call");
|
||||
|
||||
var captureLink = function(link) {
|
||||
if (window.__CALL_LINK_CAPTURED__) return;
|
||||
console.log("[BOT] VKCalls: call link:", link);
|
||||
window.__CALL_LINK__ = link;
|
||||
window.__CALL_LINK_CAPTURED__ = true;
|
||||
};
|
||||
|
||||
var origFetch = window.fetch;
|
||||
window.fetch = function() {
|
||||
var args = arguments;
|
||||
@@ -49,24 +49,32 @@
|
||||
var clone = res.clone();
|
||||
clone.text().then(function(text) {
|
||||
if (text.indexOf(CALL_IN_PROGRESS_KEY) === -1) return;
|
||||
var json = JSON.parse(text);
|
||||
var items = json && json.response && json.response[1] && json.response[1].items;
|
||||
if (!items) return;
|
||||
for (var j = 0; j < items.length; j++) {
|
||||
var join = items[j] && items[j].call_in_progress && items[j].call_in_progress.join_link;
|
||||
if (join) {
|
||||
var link = VK_CALL_BASE + join;
|
||||
console.log("[BOT] VKCalls: call link:", link);
|
||||
window.__CALL_LINK__ = link;
|
||||
window.__CALL_LINK_CAPTURED__ = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var match = text.match(/"join_link"\s*:\s*"([^"]+)"/);
|
||||
if (match) captureLink(VK_CALL_BASE + match[1]);
|
||||
});
|
||||
} catch (e) {}
|
||||
return res;
|
||||
});
|
||||
};
|
||||
|
||||
var pollLink = setInterval(function() {
|
||||
if (window.__CALL_LINK_CAPTURED__) { clearInterval(pollLink); return; }
|
||||
var linkBtn = document.querySelector('[data-testid="call_management_toolbar_button_link"]');
|
||||
if (!linkBtn) return;
|
||||
linkBtn.click();
|
||||
setTimeout(function() {
|
||||
var inputs = document.querySelectorAll('input[readonly], input[type="text"]');
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
var val = inputs[i].value || '';
|
||||
if (val.indexOf('vk.com/call/join/') !== -1) {
|
||||
captureLink(val);
|
||||
clearInterval(pollLink);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}, 500);
|
||||
}, 3000);
|
||||
|
||||
return true;
|
||||
});
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user