|
|
|
@ -6,12 +6,10 @@ from time import sleep |
|
|
|
import base64 |
|
|
|
import base64 |
|
|
|
import json |
|
|
|
import json |
|
|
|
import requests |
|
|
|
import requests |
|
|
|
from sshtunnel import open_tunnel |
|
|
|
|
|
|
|
import paramiko |
|
|
|
|
|
|
|
from getpass import getpass |
|
|
|
|
|
|
|
import arangodb |
|
|
|
|
|
|
|
import config |
|
|
|
import config |
|
|
|
from helpers import now |
|
|
|
from helpers import now |
|
|
|
|
|
|
|
import dbViaSSH |
|
|
|
|
|
|
|
|
|
|
|
# Gör fb-scraper till arbetsmapp |
|
|
|
# Gör fb-scraper till arbetsmapp |
|
|
|
chdir(dirname(dirname(abspath(__file__)))) |
|
|
|
chdir(dirname(dirname(abspath(__file__)))) |
|
|
|
@ -268,26 +266,15 @@ if __name__ == "__main__": |
|
|
|
row = row.replace("https:", "https;") |
|
|
|
row = row.replace("https:", "https;") |
|
|
|
data.append(row.split(sep)) |
|
|
|
data.append(row.split(sep)) |
|
|
|
|
|
|
|
|
|
|
|
# Lägg in i accs |
|
|
|
# # Lägg in i accs |
|
|
|
# Öppna SSH-tunnel till RBP/db. |
|
|
|
|
|
|
|
pwd_key = getpass("Password for rsa-key: ") |
|
|
|
db = dbViaSSH.db_over_tunnel('Accs') |
|
|
|
with open_tunnel( |
|
|
|
|
|
|
|
("studio-garda.asuscomm.com", 2210), |
|
|
|
|
|
|
|
ssh_username="lasse", |
|
|
|
|
|
|
|
ssh_pkey=paramiko.RSAKey.from_private_key_file( |
|
|
|
|
|
|
|
"/Users/Lasse/.ssh/id_rsa", password=pwd_key |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
ssh_private_key_password=pwd_key, |
|
|
|
|
|
|
|
remote_bind_address=("127.0.0.1", 8529), |
|
|
|
|
|
|
|
) as server: |
|
|
|
|
|
|
|
port_arango = server.local_bind_port |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
db = arangodb.arango_connect( |
|
|
|
|
|
|
|
"concert-hangar-mirth-salk-DECAL", |
|
|
|
|
|
|
|
username="Accs", |
|
|
|
|
|
|
|
host_arango="http://127.0.0.1", |
|
|
|
|
|
|
|
port_arango=port_arango, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
#webshare_proxies() |
|
|
|
#webshare_proxies() |
|
|
|
|
|
|
|
|
|
|
|
to_accs(db, data, info, profiles, vendor) |
|
|
|
to_accs(db, data, info, profiles, vendor) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dbViaSSH.stop_server() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|