Skip to content

Instantly share code, notes, and snippets.

@seeya
seeya / extract.js
Created January 19, 2019 05:25
Extract streammango links from 9anime. This is meant to be used using chrome. Open the developer console and dump this code in while you're in a anime page. Example https://www2.9anime.to/watch/fairy-tail.n48/j76vm3
var links = [];
$(".server").each(function() {
if($(this).data("name") == 34) {
$(this).find("a").each(function() {
const id = $(this).data("id");
links.push(`https://www2.9anime.to/ajax/episode/info?id=${id}`);
});
}
});
@seeya
seeya / ytchannel-dl-parallel.sh
Created October 21, 2018 08:54
Download all videos from youtube channel in parallel using 1 line
youtube-dl --get-id $1 | machma -p 6 -- youtube-dl -f best -- {}
@seeya
seeya / setup_swap.sh
Created September 13, 2018 02:41
Setup swap space
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
@seeya
seeya / tdlib_installer.sh
Created September 13, 2018 02:41
tdlib building
apt-get install ccache libssl-dev zlib1g-dev build-essential gperf libreadline-dev cmake git
git clone https://github.com/tdlib/td.git
cd td
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -- -j5
make install
@seeya
seeya / extract.js
Created July 22, 2018 11:40
Maplestage link extractor
// parallel download - https://github.com/fd0/machma
// dailymotion downloader - https://github.com/soimort/you-get
// Save the extracted links in a file
$("option").each(function() {
let base = "http://maplestage.com";
let link = $(this).attr("value");
$.get(`${base}${link}`,function(data) {
let title = $(data).find("option:selected").text().replace(" ", "");
let id = data.split(`"name":"dailymotion","videos":[{"id":"`)[1].split(`"`)[0];
@seeya
seeya / watchasian.js
Last active July 10, 2018 13:11
Grab download link
let start = 1;
let end = 41;
for(let i=start; i<=end; i++) {
$.get(`https://www3.watchasian.co/triumph-in-the-skies-2-episode-${i}.html`, function(data) {
let link = $(data).find('.streamango').data('video');
let name = "TriumphInTheSkiesE";
console.log(`${link}#name=${name}${i}.mp4`);
});
}
@seeya
seeya / watchanimeonline_extractor.js
Created June 21, 2018 16:50
watchanimeonline.me link extractor
// Example: http://watchanimeonline.me/megalo-box-sub/
// Paste code snippet in developer console
// Ensure CORS enabled
const base = "http://watchanimeonline.me/wp-content/themes/magxp/film/getlink.php?link=";
$(".les-content").eq(0).find("span").each(async function(i) {
let id = $(this).data("link");
let response = await $.get(`${base}${id}`);
let showName = response.split("&title=")[1].split(' sandbox')[0];
let r = await $.get($(response).attr("src"));
@seeya
seeya / kissasian_link_extractor.js
Last active June 15, 2018 17:35
Extract rapidvideo links from kissasian through Chrome's console tab.
@seeya
seeya / genesis_public_key
Last active February 8, 2018 16:09
genesis_public_key
04b2b83481d8e2e860103a410032ea0e6c6e4673b599331ab4a307bcdc64dda3f9bb7218ec9825e3e56bc16d44ebbfc6f829d2c207a38fc5a001067efd86f833b8 yddmat
@seeya
seeya / pac.js
Created October 27, 2017 07:39
PAC with nodejs request
// Using a PAC file with request nodejs
// https://blog.birkhoff.me/node-js-request-via-local-pac-file/
// npm install pac-proxy-agent
var request = require("request");
var pacURL = 'http://127.0.0.1:16823/proxy_on.pac';
var agent = new require('pac-proxy-agent')('pac+' + pacURL);
var reqURL = 'https://www.google.com.tw';
request({ url: reqURL, agent: agent }, function (error, response, body) {