add iptubes submodule

This commit is contained in:
poka 2020-03-17 18:33:27 +01:00
parent 0c45f1062f
commit 14af9aa2a8
5 changed files with 1209 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "astroport-iptubes"]
path = iptubes
url = https://git.p2p.legal/axiom-team/astroport-iptubes

2
iptubes/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
data/*
ygg-crawler/node_modules/

47
iptubes/install.sh Normal file
View File

@ -0,0 +1,47 @@
#!/bin/bash
echo -e "Installing Astroport"
# Install IPFS
ipfs() {
echo -e "${c_yellow}Onboarding IPFS...$c_"
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
if [[ $ARM == "yes" ]]; then
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
else
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
fi
echo "INSTALL ipfs-update"
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err+="Untar ipfs-update"
rm $MY_PATH/ipfs-update.tar.gz
cd /usr/src/ipfs-update/
sudo ./install.sh || err+="Install ipfs-update"
cd $MY_PATH
echo "INSTALL latest ipfs"
sudo ipfs-update install latest || err+="Install IPFS"
echo "CREATE SYSTEMD ipfs SERVICE"
[[ -f /etc/systemd/system/ipfs.service ]] && sudo rm /etc/systemd/system/ipfs.service
sudo cp -f $MY_PATH/templates/1/ipfs.service /etc/systemd/system/
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
sudo systemctl daemon-reload || err+="Restart IPFS"
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
}
# Install ScuttleButt
scuttlebutt() {
}
# Check installs
## Check IPFS install
[[ $force_req == "o" || -z $(which ipfs) ]] && ipfs
echo -e "Installation Complete"
exit 0

80
iptubes/ygg-crawler/crawl.js Executable file
View File

@ -0,0 +1,80 @@
const YGG = require('yggtorrent');
var client = new YGG();
client.set_credential('kopa4', 'Ck695bvkyvPT0PJeYMOPUc');
/*
// list categories
client.get_categories(function(result) {
console.log(result);
});
// get nfo as text file
client.get_nfo(function(result) {
console.log(result);
}, id);
// get description as htlm format
client.get_info(function(result) {
console.log(result);
}, id);
// search torrents
client.search(function(result, page) {
console.log(result, page);
}, 'interstellar');
// download and parse a .torrent
client.get_torrent(function(buf, error) {
// `buf` is a Buffer or null, `error` is string or null
if (error)
console.log(error);
else
{
var parsed = require('parse-torrent')(buf);
console.log(parsed);
}
}, id);
// get top day torrents
client.get_top_day(function(result, error) {
if (error)
console.log(error);
else
console.log(result);
});
// get top week torrents
client.get_top_week(function(result, error) {
if (error)
console.log(error);
else
console.log(result);
});
// get top month torrents
client.get_top_month(function(result, error) {
if (error)
console.log(error);
else
console.log(result);
});
// get most seeded torrents
client.get_mostseeded(function(result, error) {
if (error)
console.log(error);
else
console.log(result);
});
// get most completed torrents
client.get_mostcompleted(function(result, error) {
if (error)
console.log(error);
else
console.log(result);
});
*/

1077
iptubes/ygg-crawler/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff