diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3852f81..bc77dd7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,17 @@ before_script: + - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - - ssh-add <(echo "$SSH_PRIVATE_KEY") + - echo -n "$SSH_PRIVATE_KEY" | base64 -d | tr -d '\r' | ssh-add - - mkdir -p ~/.ssh - - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - chmod 700 ~/.ssh + - ssh-keyscan "$SSH_SERVER_HOSTKEYS" >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + + + deploy: script: + - echo "STARTING DEPLOYING" - ssh $HOST "bash $SCRIPT_PATH" only: - master \ No newline at end of file diff --git a/wbijamcda.user.js b/wbijamlink.user.js similarity index 76% rename from wbijamcda.user.js rename to wbijamlink.user.js index 9f79564..68e38d1 100644 --- a/wbijamcda.user.js +++ b/wbijamlink.user.js @@ -1,9 +1,9 @@ // ==UserScript== -// @name CDA - wbijam.pl +// @name GimmeLink - wbijam.pl // @namespace Return to Luna Scripts // @match https://*.wbijam.pl/* // @grant none -// @version 1.0 +// @version 1.1.0 // @author mlunax // @description 5/5/2021, 6:58:17 PM // @include https://*.wbijam.pl/* @@ -23,15 +23,19 @@ style.innerText = ` document.head.appendChild(style); for (const el of document.querySelectorAll("span.odtwarzacz_link")) { const but = document.createElement("button"); - but.innerText = "Gimme CDA link"; + but.innerText = "Gimme video link"; but.onclick = () => { const url = el.getAttribute("rel"); fetch(`https://${document.location.host}/odtwarzacz-${url}.html`).then(e => { e.text().then(t => { const dom = new DOMParser().parseFromString(t, "text/html"); const h = dom.querySelector('iframe[src*="cda.pl"]'); + const vkh = dom.querySelector('span[class="odtwarzaj_vk"]'); if (h){ alert(h.src); + } else if (vkh) { + const vkUrl = "https://vk.com/video" + vkh.getAttribute("rel") + "_" + vkh.id; + alert(vkUrl); } }) })