Valutazione discussione:
  • 0 voto(i) - 0 media
  • 1
  • 2
  • 3
  • 4
  • 5
creare template html per instbot phyton
#91
Se non vedi i database che dovrebbero essere stati creati, vuol dire che c'è qualcosa che non funziona. I database dovrebbero trovarsi nella stessa cartella dell'unico database presente.

E' possibile eseguire degli script a ogni avvio del server (senza distinguere il motivo per cui il server è stato spento in precedenza) utilizzando il comando @reboot.

Quindi dove c'è:
Codice PHP:
$crontab->append_cronjob('01 06 * * * /percorso/del/file/ecc....'); 

Dovresti aggiungere:
Codice PHP:
$crontab->append_cronjob('@reboot /percorso/del/file/ecc....'); 
Mattia!
Cita messaggio
#92
ah ok, quindi devo aggiungere un'altra riga praticamente identica col reboot al posto del cron... però immagino che questa cosa funzionerà dagli script che creo d'ora in poi e non per quelli già creati, corretto?

se così fosse, dovrebbe essere giusto così:
Codice:
$crontab->append_cronjob('01 06 * * * /var/www/vincisinstabot/web/'.
$username.'.py >> /var/www/vincisinstabot/web/'.$username.'.log 2>&1');
$crontab->append_cronjob('@reboot /var/www/vincisinstabot/web/'.
$username.'.py >> /var/www/vincisinstabot/web/'.$username.'.log 2>&1');
echo '<p>Creazione OK</p>';
Cita messaggio
#93
Sì, naturalmente funzionerà solo per quelli nuovi.
Mattia!
Cita messaggio
#94
ok, riprovo a ti so dire dopo qualche giorno di test... grazie Smile

per quanto riguarda la creazione del singolo database per utente, secondo me bisogna inserire una funzione su instascript che duplichi il file follows_db.db (già presente nella cartella web) e lo rinomini col nomedellutente.db (come abbiamo già impostato). Forse è questo il passaggio che manca e per cui non vengono creati i database dei signoli utenti nella cartella web.

Che dici?
Cita messaggio
#95
Lo script utilizza SQLite che dovrebbe creare automaticamente il file del database, se non lo trova durante la connessione.
Su GitHub non trovo il file "follows_db.db", quindi dovrebbe averlo creato automaticamente in una delle prime prove.
Mattia!
Cita messaggio
#96
e allora andrebbe capito perchè non crea i nuovi database correttamente...
Cita messaggio
#97
Per prima cosa dovresti verificare se viene aggiornato ancora il database "follows_db.db" (basta controllare la data di modifica del file), perché significherebbe che non è stato passato correttamente il nome del database allo script.
Mattia!
Cita messaggio
#98
no, il db "follows_db.db" non viene aggiornato da fine giugno...
Cita messaggio
#99
La cartella in cui si trova il database "follows_db.db" che permessi ha? Forse SQLite non riesce a creare il file perché non ha i permessi per farlo.

Se ci sono i permessi, si dovrebbe controllare il codice dei file ".py" creati.
Mattia!
Cita messaggio
"follows_db.db" si trova nella stessa cartella dove vengono creati i file ".py", quindi non credo si tratti di un problema di permessi...
che dici?
Cita messaggio
Prova a pubblicare qui il codice di uno degli ultimi file ".py" creati (naturalmente censurando i dati sensibili come username e password) così provo a vedere se c'è qualcosa nel codice che non va.
Mattia!
Cita messaggio
eccolo qui:
Codice:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time

from src import InstaBot
from src.check_status import check_status
from src.feed_scanner import feed_scanner
from src.follow_protocol import follow_protocol
from src.unfollow_protocol import unfollow_protocol

bot = InstaBot(
    login="username",
    password="password",
    database_name="fakechatapp.db",
    like_per_day=1000,
    comments_per_day=150,
    tag_list=["firstpost","follow4follow","f4f","fakechat","italia","link","amicizia","ridere","ridigratis","risate","women","woman","nice","cool","screenshot","instaitalia","meme","memeita","funny","cazzate","memes","italy","italia365","friend","friendzone","amici","amiche","cherisate","ridiamoinsieme","ridichetipassa","follow","MadeInItaly","cazzateboom","lol"],
    tag_blacklist=['rain', 'thunderstorm'],
    user_blacklist={},
    max_like_for_one_tag=50,
    follow_per_day=10,
    follow_time=1 * 60,
    unfollow_per_day=0,
    unfollow_break_min=15,
    unfollow_break_max=30,
    log_mod=0,
    proxy='',
    # List of list of words, each of which will be used to generate comment
    # For example: "This shot feels wow!"
    comment_list=[[":)",":D","<3","(:",";)",":O"]],
    # Use unwanted_username_list to block usernames containing a string
    ## Will do partial matches; i.e. 'mozart' will block 'legend_mozart'
    ### 'free_followers' will be blocked because it contains 'free'
    unwanted_username_list=[
        'second', 'stuff', 'art', 'project', 'love', 'life', 'food', 'blog',
        'free', 'keren', 'photo', 'graphy', 'indo', 'travel', 'art', 'shop',
        'store', 'sex', 'toko', 'jual', 'online', 'murah', 'jam', 'kaos',
        'case', 'baju', 'fashion', 'corp', 'tas', 'butik', 'grosir', 'karpet',
        'sosis', 'salon', 'skin', 'care', 'cloth', 'tech', 'rental', 'kamera',
        'beauty', 'express', 'kredit', 'collection', 'impor', 'preloved',
        'follow', 'follower', 'gain', '.id', '_id', 'bags'
    ],
    unfollow_whitelist=['example_user_1', 'example_user_2'])
while True:

    #print("# MODE 0 = ORIGINAL MODE BY LEVPASHA")
    #print("## MODE 1 = MODIFIED MODE BY KEMONG")
    #print("### MODE 2 = ORIGINAL MODE + UNFOLLOW WHO DON'T FOLLOW BACK")
    #print("#### MODE 3 = MODIFIED MODE : UNFOLLOW USERS WHO DON'T FOLLOW YOU BASED ON RECENT FEED")
    #print("##### MODE 4 = MODIFIED MODE : FOLLOW USERS BASED ON RECENT FEED ONLY")
    #print("###### MODE 5 = MODIFIED MODE : JUST UNFOLLOW EVERYBODY, EITHER YOUR FOLLOWER OR NOT")

    ################################
    ##  WARNING   ###
    ################################

    # DON'T USE MODE 5 FOR A LONG PERIOD. YOU RISK YOUR ACCOUNT FROM GETTING BANNED
    ## USE MODE 5 IN BURST MODE, USE IT TO UNFOLLOW PEOPLE AS MANY AS YOU WANT IN SHORT TIME PERIOD

    mode = 0

    #print("You choose mode : %i" %(mode))
    #print("CTRL + C to cancel this operation or wait 30 seconds to start")
    #time.sleep(30)

    if mode == 0:
        bot.new_auto_mod()

    elif mode == 1:
        check_status(bot)
        while bot.self_following - bot.self_follower > 200:
            unfollow_protocol(bot)
            time.sleep(10 * 60)
            check_status(bot)
        while bot.self_following - bot.self_follower < 400:
            while len(bot.user_info_list) < 50:
                feed_scanner(bot)
                time.sleep(5 * 60)
                follow_protocol(bot)
                time.sleep(10 * 60)
                check_status(bot)

    elif mode == 2:
        bot.bot_mode = 1
        bot.new_auto_mod()

    elif mode == 3:
        unfollow_protocol(bot)
        time.sleep(10 * 60)

    elif mode == 4:
        feed_scanner(bot)
        time.sleep(60)
        follow_protocol(bot)
        time.sleep(10 * 60)

    elif mode == 5:
        bot.bot_mode = 2
        unfollow_protocol(bot)

    else:
        print("Wrong mode!")
Cita messaggio
Sembra che sia tutto corretto.
Nei file di log non c'è nessun messaggio d'errore?
Mattia!
Cita messaggio
ecco un pezzo di log di "fakechatapp.py"
Citazione:19.11.2018_06:01 Instabot v1.2.0 started at 19.11.2018 06:01:

19.11.2018_06:01 Trying to login as fakechatapp...

19.11.2018_06:01 fakechatapp login success!
19.11.2018_06:01 Get media id by tag: amiche
19.11.2018_06:01 Removing already liked medias..
19.11.2018_06:01 Trying to like media: 1915796465231683685
Traceback (most recent call last):
 File "/var/www/vincisinstabot/web/fakechatapp.py", line 68, in <module>
   bot.new_auto_mod()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 698, in new_auto_mod
   self.new_auto_mod_like()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 726, in new_auto_mod_like
   if self.like_all_exist_media(media_size=1, delay=False):
 File "/var/www/vincisinstabot/web/src/instabot.py", line 527, in like_all_exist_media
   status="200")
 File "/var/www/vincisinstabot/web/src/sql_updates.py", line 68, in insert_media
   media_id +"','"+ status +"','"+ str(now) +"')")
sqlite3.OperationalError: database is locked
19.11.2018_06:01 Logout: likes - 1, follow - 0, unfollow - 0, comments - 0.
19.11.2018_06:01 Bot work time: 0:00:13.316805
19.11.2018_06:01 Logout success!
19.11.2018_06:01 Instabot v1.2.0 started at 19.11.2018 06:01:

19.11.2018_06:01 Trying to login as fakechatapp...

19.11.2018_06:01 fakechatapp login success!
19.11.2018_06:01 Get media id by tag: meme
19.11.2018_06:01 Removing already liked medias..
19.11.2018_06:01 Trying to like media: 1915820035324498271
Traceback (most recent call last):
 File "/var/www/vincisinstabot/web/fakechatapp.py", line 68, in <module>
   bot.new_auto_mod()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 698, in new_auto_mod
   self.new_auto_mod_like()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 726, in new_auto_mod_like
   if self.like_all_exist_media(media_size=1, delay=False):
 File "/var/www/vincisinstabot/web/src/instabot.py", line 527, in like_all_exist_media
   status="200")
 File "/var/www/vincisinstabot/web/src/sql_updates.py", line 68, in insert_media
   media_id +"','"+ status +"','"+ str(now) +"')")
sqlite3.OperationalError: database is locked
19.11.2018_06:01 Logout: likes - 1, follow - 0, unfollow - 0, comments - 0.
19.11.2018_06:01 Bot work time: 0:00:14.657237
19.11.2018_06:01 Logout success!
19.11.2018_06:01 Instabot v1.2.0 started at 19.11.2018 06:01:

19.11.2018_06:01 Trying to login as fakechatapp...

19.11.2018_06:01 fakechatapp login success!
19.11.2018_06:01 Get media id by tag: firstpost
19.11.2018_06:01 Removing already liked medias..
19.11.2018_06:01 Trying to like media: 1915820819877240202
Traceback (most recent call last):
 File "/var/www/vincisinstabot/web/fakechatapp.py", line 68, in <module>
   bot.new_auto_mod()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 698, in new_auto_mod
   self.new_auto_mod_like()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 726, in new_auto_mod_like
   if self.like_all_exist_media(media_size=1, delay=False):
 File "/var/www/vincisinstabot/web/src/instabot.py", line 527, in like_all_exist_media
   status="200")
 File "/var/www/vincisinstabot/web/src/sql_updates.py", line 68, in insert_media
   media_id +"','"+ status +"','"+ str(now) +"')")
sqlite3.OperationalError: database is locked
19.11.2018_06:01 Instabot v1.2.0 started at 19.11.2018 06:01:

19.11.2018_06:01 Trying to login as fakechatapp...

19.11.2018_06:01 fakechatapp login success!
19.11.2018_06:01 Get media id by tag: funny
19.11.2018_06:01 Removing already liked medias..
19.11.2018_06:01 Trying to like media: 1915820035324498271
Traceback (most recent call last):
 File "/var/www/vincisinstabot/web/fakechatapp.py", line 68, in <module>
   bot.new_auto_mod()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 698, in new_auto_mod
   self.new_auto_mod_like()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 726, in new_auto_mod_like
   if self.like_all_exist_media(media_size=1, delay=False):
 File "/var/www/vincisinstabot/web/src/instabot.py", line 527, in like_all_exist_media
   status="200")
 File "/var/www/vincisinstabot/web/src/sql_updates.py", line 68, in insert_media
   media_id +"','"+ status +"','"+ str(now) +"')")
sqlite3.OperationalError: database is locked
19.11.2018_06:01 Logout: likes - 1, follow - 0, unfollow - 0, comments - 0.
19.11.2018_06:01 Bot work time: 0:00:15.560245
19.11.2018_06:01 Logout success!
19.11.2018_06:01 Logout: likes - 1, follow - 0, unfollow - 0, comments - 0.
19.11.2018_06:01 Bot work time: 0:00:15.886042
19.11.2018_06:01 Logout success!
20.11.2018_06:01 Instabot v1.2.0 started at 20.11.2018 06:01:

20.11.2018_06:01 Trying to login as fakechatapp...

20.11.2018_06:01 fakechatapp login success!
20.11.2018_06:01 Get media id by tag: risate
20.11.2018_06:01 Removing already liked medias..
20.11.2018_06:01 Trying to like media: 1916541884228261914
20.11.2018_06:01 Liked: 1916541884228261914. Like #1.
20.11.2018_06:01 Trying to follow: 7556493923
20.11.2018_06:01 Followed: 7556493923 #1.
20.11.2018_06:01 Trying to comment: 1916541733266914454
20.11.2018_06:01 Write: ":d". #1.
20.11.2018_06:03 Trying to like media: 1916541733266914454
20.11.2018_06:03 Liked: 1916541733266914454. Like #2.
20.11.2018_06:04 Trying to like media: 1916541576592836643
20.11.2018_06:04 Liked: 1916541576592836643. Like #3.
20.11.2018_06:05 Trying to like media: 1916541393184301715
20.11.2018_06:05 Liked: 1916541393184301715. Like #4.
20.11.2018_06:07 Trying to like media: 1916541235688190689
20.11.2018_06:07 Liked: 1916541235688190689. Like #5.
20.11.2018_06:08 Trying to like media: 1916541072739531392
20.11.2018_06:08 Liked: 1916541072739531392. Like #6.
20.11.2018_06:10 Keep calm - It's already liked smilie
20.11.2018_06:10 Keep calm - It's already liked smilie
20.11.2018_06:10 Trying to like media: 1916525836888370507
20.11.2018_06:10 Liked: 1916525836888370507. Like #7.
20.11.2018_06:11 Trying to comment: 1916523979934340044
20.11.2018_06:11 Write: ":o". #2.
20.11.2018_06:11 Trying to like media: 1916523979934340044
20.11.2018_06:11 Liked: 1916523979934340044. Like #8.
20.11.2018_06:11 Get media id by tag: memes
20.11.2018_06:11 Removing already liked medias..
20.11.2018_06:13 Trying to like media: 1916549014319228093
20.11.2018_06:13 Liked: 1916549014319228093. Like #9.
20.11.2018_06:14 Trying to like media: 1916551006907057843
20.11.2018_06:14 Liked: 1916551006907057843. Like #10.
20.11.2018_06:16 Trying to like media: 1916550600252067000
20.11.2018_06:16 Liked: 1916550600252067000. Like #11.
20.11.2018_06:17 Trying to like media: 1916550992017477761
20.11.2018_06:17 Liked: 1916550992017477761. Like #12.
20.11.2018_06:19 Trying to like media: 1916550985330057807
20.11.2018_06:19 Liked: 1916550985330057807. Like #13.
20.11.2018_06:20 Trying to like media: 1916550991287007781
20.11.2018_06:20 Liked: 1916550991287007781. Like #14.
20.11.2018_06:20 Trying to comment: 1916550954392882444
20.11.2018_06:20 Write: "<3". #3.
20.11.2018_06:22 Trying to like media: 1916550954392882444
20.11.2018_06:22 Liked: 1916550954392882444. Like #15.
20.11.2018_06:23 Trying to like media: 1916550957866738922
20.11.2018_06:23 Liked: 1916550957866738922. Like #16.
20.11.2018_06:25 Trying to like media: 1916550950191750827
20.11.2018_06:25 Liked: 1916550950191750827. Like #17.
20.11.2018_06:26 Trying to like media: 1916550941132003410
20.11.2018_06:26 Liked: 1916550941132003410. Like #18.
20.11.2018_06:28 Trying to like media: 1916550929294043307
20.11.2018_06:28 Liked: 1916550929294043307. Like #19.
20.11.2018_06:29 Trying to like media: 1916550933203105841
20.11.2018_06:29 Liked: 1916550933203105841. Like #20.
20.11.2018_06:30 Trying to comment: 1916550922222287308
20.11.2018_06:30 Write: "smilie". #4.
20.11.2018_06:31 Trying to like media: 1916550922222287308
20.11.2018_06:31 Liked: 1916550922222287308. Like #21.
Traceback (most recent call last):
 File "/var/www/vincisinstabot/web/fakechatapp.py", line 68, in <module>
   bot.new_auto_mod()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 698, in new_auto_mod
   self.new_auto_mod_like()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 726, in new_auto_mod_like
   if self.like_all_exist_media(media_size=1, delay=False):
 File "/var/www/vincisinstabot/web/src/instabot.py", line 474, in like_all_exist_media
   if check_already_liked(self, media_id=self.media_by_tag[i]['node']['id']) == 1:
 File "/var/www/vincisinstabot/web/src/sql_updates.py", line 53, in check_already_liked
   media_id + "' LIMIT 1)").fetchone()[0] > 0:
sqlite3.OperationalError: database is locked
20.11.2018_06:32 Trying to unfollow: 7556493923
20.11.2018_06:32 Unfollow: 7556493923 #1 of 1.
20.11.2018_06:32 Pausing for 20 seconds... 1 of 1
20.11.2018_06:33 Logout: likes - 21, follow - 1, unfollow - 1, comments - 4.
20.11.2018_06:33 Bot work time: 0:32:09.337472
20.11.2018_06:33 Logout success!
20.11.2018_06:01 Instabot v1.2.0 started at 20.11.2018 06:01:

20.11.2018_06:01 Trying to login as fakechatapp...

20.11.2018_06:01 fakechatapp login success!
20.11.2018_06:01 Get media id by tag: italia365
20.11.2018_06:01 Removing already liked medias..
20.11.2018_06:01 Trying to like media: 1916537371903354417
20.11.2018_06:01 Liked: 1916537371903354417. Like #1.
20.11.2018_06:01 Trying to follow: 6031574929
20.11.2018_06:01 Followed: 6031574929 #1.
20.11.2018_06:01 Trying to comment: 1916530908833695621
20.11.2018_06:01 Write: "Bellerrima :d". #1.
20.11.2018_06:01 Trying to follow: 6031574929
20.11.2018_06:01 Followed: 6031574929 #2.
20.11.2018_06:02 Trying to like media: 1916530908833695621
20.11.2018_06:02 Liked: 1916530908833695621. Like #2.
20.11.2018_06:04 Trying to like media: 1916486001024162604
20.11.2018_06:04 Liked: 1916486001024162604. Like #3.
20.11.2018_06:05 Trying to like media: 1916426463440042263
20.11.2018_06:05 Liked: 1916426463440042263. Like #4.
20.11.2018_06:07 Trying to like media: 1916424050448616782
20.11.2018_06:07 Liked: 1916424050448616782. Like #5.
20.11.2018_06:08 Trying to like media: 1916418744243001655
20.11.2018_06:08 Liked: 1916418744243001655. Like #6.
20.11.2018_06:10 Trying to like media: 1916402164077323070
20.11.2018_06:10 Liked: 1916402164077323070. Like #7.
20.11.2018_06:10 Trying to comment: 1916390609254573567
20.11.2018_06:10 Write: "Smile". #2.
20.11.2018_06:11 Trying to like media: 1916386625999470308
20.11.2018_06:11 Liked: 1916386625999470308. Like #8.
20.11.2018_06:13 Trying to like media: 1916380937803256495
20.11.2018_06:13 Liked: 1916380937803256495. Like #9.
20.11.2018_06:14 Trying to like media: 1916376225050180099
20.11.2018_06:14 Liked: 1916376225050180099. Like #10.
20.11.2018_06:16 Trying to like media: 1916370159028986864
20.11.2018_06:16 Liked: 1916370159028986864. Like #11.
20.11.2018_06:17 Trying to like media: 1916368552477007605
20.11.2018_06:17 Liked: 1916368552477007605. Like #12.
20.11.2018_06:19 Trying to like media: 1916368395953883573
20.11.2018_06:19 Liked: 1916368395953883573. Like #13.
20.11.2018_06:19 Trying to comment: 1916366321239737920
20.11.2018_06:19 Write: "Xd". #3.
20.11.2018_06:20 Trying to like media: 1916366254686169891
20.11.2018_06:20 Liked: 1916366254686169891. Like #14.
20.11.2018_06:22 Trying to like media: 1916360032729935082
20.11.2018_06:22 Liked: 1916360032729935082. Like #15.
20.11.2018_06:23 Trying to like media: 1916359486965130622
20.11.2018_06:23 Liked: 1916359486965130622. Like #16.
20.11.2018_06:25 Trying to like media: 1916355354074226111
20.11.2018_06:25 Liked: 1916355354074226111. Like #17.
20.11.2018_06:26 Trying to like media: 1916353604857710744
20.11.2018_06:26 Liked: 1916353604857710744. Like #18.
20.11.2018_06:28 Trying to like media: 1916352179951065538
20.11.2018_06:28 Liked: 1916352179951065538. Like #19.
20.11.2018_06:28 Trying to comment: 1916351333038753691
20.11.2018_06:28 Write: "Smile". #4.
20.11.2018_06:29 Trying to like media: 1916341501665012654
20.11.2018_06:29 Liked: 1916341501665012654. Like #20.
20.11.2018_06:31 Trying to like media: 1916341152900194314
20.11.2018_06:31 Liked: 1916341152900194314. Like #21.
20.11.2018_06:31 Get media id by tag: funny
20.11.2018_06:31 Removing already liked medias..
20.11.2018_06:32 Trying to like media: 1916560825636902647
20.11.2018_06:32 Liked: 1916560825636902647. Like #22.
20.11.2018_06:34 Trying to like media: 1916560800111610668
20.11.2018_06:34 Liked: 1916560800111610668. Like #23.
20.11.2018_06:35 Trying to like media: 1916560793768414921
20.11.2018_06:35 Liked: 1916560793768414921. Like #24.
20.11.2018_06:37 Trying to like media: 1916560780582853219
20.11.2018_06:37 Liked: 1916560780582853219. Like #25.
20.11.2018_06:38 Trying to like media: 1916560767504071050
20.11.2018_06:38 Liked: 1916560767504071050. Like #26.
20.11.2018_06:38 Trying to comment: 1916559164768231864
20.11.2018_06:38 Write: "Smile". #5.
20.11.2018_06:40 Trying to like media: 1916559164768231864
20.11.2018_06:40 Liked: 1916559164768231864. Like #27.
20.11.2018_06:41 Trying to like media: 1920.11.2018_06:01 Instabot v1.2.0 started at 20.11.2018 06:01:

20.11.2018_06:01 Trying to login as fakechatapp...

20.11.2018_06:01 fakechatapp login success!
20.11.2018_06:01 Get media id by tag: ridere
20.11.2018_06:01 Removing already liked medias..
20.11.2018_06:01 Trying to like media: 1916544360728749878
20.11.2018_06:01 Liked: 1916544360728749878. Like #1.
20.11.2018_06:01 Trying to follow: 3512231580
20.11.2018_06:01 Followed: 3512231580 #1.
20.11.2018_06:01 Trying to comment: 1916540584622214383
20.11.2018_06:01 Write: "Smile". #1.
20.11.2018_06:02 Trying to like media: 1916540584622214383
20.11.2018_06:02 Liked: 1916540584622214383. Like #2.
20.11.2018_06:03 Trying to like media: 1916535413760000708
20.11.2018_06:03 Liked: 1916535413760000708. Like #3.
20.11.2018_06:05 Trying to like media: 1916534934225232942
20.11.2018_06:05 Liked: 1916534934225232942. Like #4.
20.11.2018_06:06 Trying to like media: 1916521710237913602
20.11.2018_06:06 Liked: 1916521710237913602. Like #5.
20.11.2018_06:08 Trying to like media: 1916507942543606606
20.11.2018_06:08 Liked: 1916507942543606606. Like #6.
20.11.2018_06:09 Trying to like media: 1916500693042924750
20.11.2018_06:09 Liked: 1916500693042924750. Like #7.
20.11.2018_06:11 Trying to like media: 1916471340657225717
20.11.2018_06:11 Liked: 1916471340657225717. Like #8.
20.11.2018_06:11 Trying to comment: 1916457345866870337
20.11.2018_06:11 Write: "Smile". #2.
20.11.2018_06:12 Trying to like media: 1916449098597230640
20.11.2018_06:12 Liked: 1916449098597230640. Like #9.
20.11.2018_06:12 Get media id by tag: MadeInItaly
20.11.2018_06:12 Removing already liked medias..
20.11.2018_06:14 Trying to like media: 1916551193964286814
20.11.2018_06:14 Liked: 1916551193964286814. Like #10.
20.11.2018_06:15 Trying to like media: 1916550772317799558
20.11.2018_06:15 Liked: 1916550772317799558. Like #11.
20.11.2018_06:17 Trying to like media: 1916550565505257225
20.11.2018_06:17 Liked: 1916550565505257225. Like #12.
20.11.2018_06:18 Trying to like media: 1916550550793353096
20.11.2018_06:18 Liked: 1916550550793353096. Like #13.
20.11.2018_06:20 Trying to like media: 1916550227226500061
20.11.2018_06:20 Liked: 1916550227226500061. Like #14.
20.11.2018_06:21 Trying to like media: 1916550035421809689
20.11.2018_06:21 Liked: 1916550035421809689. Like #15.
20.11.2018_06:21 Trying to comment: 1916549724010278298
20.11.2018_06:21 Write: "Smile". #3.
20.11.2018_06:22 Trying to like media: 1916549724010278298
20.11.2018_06:22 Liked: 1916549724010278298. Like #16.
20.11.2018_06:24 Trying to like media: 1916549472302453541
20.11.2018_06:24 Liked: 1916549472302453541. Like #17.
20.11.2018_06:25 Trying to like media: 1916549193892239725
20.11.2018_06:25 Liked: 1916549193892239725. Like #18.
20.11.2018_06:26 Trying to like media: 1916547840827934003
20.11.2018_06:26 Liked: 1916547840827934003. Like #19.
20.11.2018_06:28 Trying to like media: 1916547316263073157
20.11.2018_06:28 Liked: 1916547316263073157. Like #20.
20.11.2018_06:29 Trying to like media: 1916547161477074316
20.11.2018_06:29 Liked: 1916547161477074316. Like #21.
20.11.2018_06:31 Trying to like media: 1916546703121895144
20.11.2018_06:31 Liked: 1916546703121895144. Like #22.
20.11.2018_06:31 Trying to comment: 1916546512902812900
20.11.2018_06:31 Write: "Spettacolo! Smile". #4.
20.11.2018_06:32 Trying to like media: 1916546512902812900
20.11.2018_06:32 Liked: 1916546512902812900. Like #23.
20.11.2018_06:34 Trying to like media: 1916545806749890957
20.11.2018_06:34 Liked: 1916545806749890957. Like #24.
20.11.2018_06:35 Trying to like media: 1916545615689845951
20.11.2018_06:35 Liked: 1916545615689845951. Like #25.
20.11.2018_06:37 Trying to like media: 1916545376825785826
20.11.2018_06:37 Liked: 1916545376825785826. Like #26.
20.11.2018_06:37 Get media id by tag: cazzateboom
20.11.2018_06:37 Removing already liked medias..
20.11.2018_06:40 Get media id by tag: italy
20.11.2018_06:40 Removing already liked medias..
20.11.2018_06:40 Trying to like media: 1916565491741531792
20.11.2018_06:40 Liked: 1916565491741531792. Like #27.
20.11.2018_06:42 Trying20.11.2018_06:01 Instabot v1.2.0 started at 20.11.2018 06:01:

20.11.2018_06:01 Trying to login as fakechatapp...

20.11.2018_06:01 fakechatapp login success!
20.11.2018_06:01 Get media id by tag: screenshot
20.11.2018_06:01 Removing already liked medias..
20.11.2018_06:01 Trying to like media: 1916545227022092654
20.11.2018_06:01 Liked: 1916545227022092654. Like #1.
20.11.2018_06:01 Trying to follow: 7766565636
20.11.2018_06:01 Followed: 7766565636 #1.
20.11.2018_06:01 Trying to comment: 1916545085715435142
20.11.2018_06:01 Write: "(:". #1.
20.11.2018_06:02 Trying to like media: 1916545085715435142
20.11.2018_06:02 Liked: 1916545085715435142. Like #2.
20.11.2018_06:04 Trying to like media: 1916544550598219340
20.11.2018_06:04 Liked: 1916544550598219340. Like #3.
20.11.2018_06:05 Trying to like media: 1916543810436634203
20.11.2018_06:05 Liked: 1916543810436634203. Like #4.
20.11.2018_06:07 Trying to like media: 1916543808818750603
20.11.2018_06:07 Liked: 1916543808818750603. Like #5.
20.11.2018_06:08 Trying to like media: 1916542416216064333
20.11.2018_06:08 Liked: 1916542416216064333. Like #6.
20.11.2018_06:10 Trying to like media: 1916542852249067206
20.11.2018_06:10 Liked: 1916542852249067206. Like #7.
20.11.2018_06:10 Trying to comment: 1916542663111004730
20.11.2018_06:10 Write: ":o". #2.
20.11.2018_06:11 Trying to like media: 1916542663111004730
20.11.2018_06:11 Liked: 1916542663111004730. Like #8.
20.11.2018_06:13 Trying to like media: 1916541925180170903
20.11.2018_06:13 Liked: 1916541925180170903. Like #9.
20.11.2018_06:14 Trying to like media: 1916542449067316175
20.11.2018_06:14 Liked: 1916542449067316175. Like #10.
20.11.2018_06:16 Trying to like media: 1916542286127027208
20.11.2018_06:16 Liked: 1916542286127027208. Like #11.
20.11.2018_06:17 Trying to like media: 1916542145794056799
20.11.2018_06:17 Liked: 1916542145794056799. Like #12.
20.11.2018_06:19 Trying to like media: 1916541422326949348
20.11.2018_06:19 Liked: 1916541422326949348. Like #13.
20.11.2018_06:20 Trying to comment: 1916541420187881075
20.11.2018_06:20 Write: "Bellerrima :d". #3.
20.11.2018_06:20 Trying to like media: 1916541420187881075
20.11.2018_06:20 Liked: 1916541420187881075. Like #14.
20.11.2018_06:21 Trying to like media: 1916541323240569476
20.11.2018_06:22 Liked: 1916541323240569476. Like #15.
20.11.2018_06:23 Trying to like media: 1916541220304143630
20.11.2018_06:23 Liked: 1916541220304143630. Like #16.
20.11.2018_06:24 Trying to like media: 1916540996244238248
20.11.2018_06:24 Liked: 1916540996244238248. Like #17.
20.11.2018_06:26 Trying to like media: 1916540983124555397
20.11.2018_06:26 Liked: 1916540983124555397. Like #18.
20.11.2018_06:27 Trying to like media: 1916539727071274899
20.11.2018_06:27 Liked: 1916539727071274899. Like #19.
20.11.2018_06:29 Trying to like media: 1916540558794135920
20.11.2018_06:29 Liked: 1916540558794135920. Like #20.
20.11.2018_06:30 Trying to comment: 1916539249341959746
20.11.2018_06:30 Write: "Smile". #4.
20.11.2018_06:30 Trying to like media: 1916539249341959746
20.11.2018_06:30 Liked: 1916539249341959746. Like #21.
20.11.2018_06:32 Trying to like media: 1916538984949240104
20.11.2018_06:32 Liked: 1916538984949240104. Like #22.
20.11.2018_06:33 Trying to like media: 1916537053002581906
20.11.2018_06:33 Liked: 1916537053002581906. Like #23.
20.11.2018_06:35 Trying to like media: 1916534785644405087
20.11.2018_06:35 Liked: 1916534785644405087. Like #24.
20.11.2018_06:36 Trying to like media: 1916533644919791507
20.11.2018_06:36 Liked: 1916533644919791507. Like #25.
20.11.2018_06:38 Trying to like media: 1916533625375172349
20.11.2018_06:38 Liked: 1916533625375172349. Like #26.
20.11.2018_06:39 Trying to like media: 1916532473854239180
20.11.2018_06:39 Liked: 1916532473854239180. Like #27.
20.11.2018_06:40 Trying to comment: 1916530487229381853
20.11.2018_06:40 Write: ":o". #5.
20.11.2018_06:41 Trying to like media: 1916530487229381853
20.11.2018_06:41 Liked: 1916530487229381853. Like #28.
20.11.2018_06:42 Trying to like media: 1916529525139908969
20.11.2018_06:42 Liked: 1916529525139908969. Lik16560407776978869
20.11.2018_06:41 Liked: 1916560407776978869. Like #28.
20.11.2018_06:43 Trying to like media: 1916560578115431812
20.11.2018_06:43 Liked: 1916560578115431812. Like #29.
20.11.2018_06:44 Trying to like media: 1916560614916241929
20.11.2018_06:44 Liked: 1916560614916241929. Like #30.
20.11.2018_06:46 Trying to like media: 1916560703188378062
20.11.2018_06:46 Liked: 1916560703188378062. Like #31.
20.11.2018_06:47 Trying to like media: 1916560699656590390
20.11.2018_06:47 Liked: 1916560699656590390. Like #32.
20.11.2018_06:47 Trying to comment: 1916560662161400261
20.11.2018_06:47 Write: "Bellerrima :d". #6.
20.11.2018_06:49 Trying to like media: 1916560662161400261
20.11.2018_06:49 Liked: 1916560662161400261. Like #33.
20.11.2018_06:51 Trying to like media: 1916560620167612051
20.11.2018_06:51 Liked: 1916560620167612051. Like #34.
20.11.2018_06:52 Trying to like media: 1916560156888502134
20.11.2018_06:52 Liked: 1916560156888502134. Like #35.
20.11.2018_06:54 Trying to like media: 1916560609573253916
20.11.2018_06:54 Liked: 1916560609573253916. Like #36.
20.11.2018_06:55 Trying to like media: 1916560610527587405
20.11.2018_06:55 Liked: 1916560610527587405. Like #37.
20.11.2018_06:57 Trying to like media: 1916560611670483432
20.11.2018_06:57 Liked: 1916560611670483432. Like #38.
20.11.2018_06:57 Trying to comment: 1916559890961560251
20.11.2018_06:57 Write: "smilie". #7.
20.11.2018_06:58 Trying to like media: 1916559890961560251
20.11.2018_06:58 Liked: 1916559890961560251. Like #39.
20.11.2018_06:59 Trying to like media: 1916560596636418839
20.11.2018_06:59 Liked: 1916560596636418839. Like #40.
20.11.2018_07:01 Trying to like media: 1916560328840155646
20.11.2018_07:01 Liked: 1916560328840155646. Like #41.
20.11.2018_07:02 Trying to like media: 1916560329091095907
20.11.2018_07:02 Liked: 1916560329091095907. Like #42.
20.11.2018_07:04 Trying to like media: 1916560529998947636
20.11.2018_07:04 Liked: 1916560529998947636. Like #43.
20.11.2018_07:05 Trying to like media: 1916560517373956897
20.11.2018_07:05 Liked: 1916560517373956897. Like #44.
20.11.2018_07:06 Trying to comment: 1916560503019159089
20.11.2018_07:06 Write: "(:". #8.
20.11.2018_07:06 Trying to like media: 1916560503019159089
20.11.2018_07:06 Liked: 1916560503019159089. Like #45.
20.11.2018_07:08 Trying to like media: 1916560497860258319
20.11.2018_07:08 Liked: 1916560497860258319. Like #46.
20.11.2018_07:09 Trying to like media: 1916560501972102824
20.11.2018_07:09 Liked: 1916560501972102824. Like #47.
20.11.2018_07:11 Trying to like media: 1916560492484622695
20.11.2018_07:11 Liked: 1916560492484622695. Like #48.
20.11.2018_07:12 Trying to like media: 1916560427422418381
20.11.2018_07:12 Liked: 1916560427422418381. Like #49.
20.11.2018_07:14 Trying to like media: 1916560484019093523
20.11.2018_07:14 Not liked: 400
20.11.2018_07:15 Trying to comment: 1916559250810000274
20.11.2018_07:15 Write: "Xd". #9.
20.11.2018_07:15 Trying to like media: 1916559250810000274
Traceback (most recent call last):
 File "/var/www/vincisinstabot/web/fakechatapp.py", line 68, in <module>
   bot.new_auto_mod()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 698, in new_auto_mod
   self.new_auto_mod_like()
 File "/var/www/vincisinstabot/web/src/instabot.py", line 726, in new_auto_mod_like
   if self.like_all_exist_media(media_size=1, delay=False):
 File "/var/www/vincisinstabot/web/src/instabot.py", line 527, in like_all_exist_media
   status="200")
 File "/var/www/vincisinstabot/web/src/sql_updates.py", line 68, in insert_media
   media_id +"','"+ status +"','"+ str(now) +"')")
sqlite3.OperationalError: database is locked
20.11.2018_07:15 Trying to unfollow: 6031574929
20.11.2018_07:15 Unfollow: 6031574929 #1 of 2.
20.11.2018_07:15 Pausing for 23 seconds... 1 of 2
20.11.2018_07:16 Logout: likes - 50, follow - 2, unfollow - 1, comments - 9.
20.11.2018_07:16 Bot work time: 1:15:00.390677
20.11.2018_07:16 Logout success!
to like media: 1916565467179736765

la versione integrale la puoi vedere qui
Cita messaggio
L'errore relativo al database è "sqlite3.OperationalError: database is locked".
Quel messaggio dovrebbe comparire solamente quando un altro processo sta utilizzando il database, però forse il problema è dato dal fatto che per nel cron il percorso del file del database è sbagliato.

Dovresti provare a modificare lo script "fakechatapp.py" dove c'è:
Codice:
database_name="fakechatapp.db",

In questo modo:
Codice:
database_name="/var/www/vincisinstabot/web/fakechatapp.db",

Se così funziona, bisogna modificare tutti gli script ".py" e quello in PHP che li crea.
Mattia!
Cita messaggio
infatti ora che me lo hai fatto notare, ho vito che i database vengono creati, ma nel percorso sbagliato! infatti me li trovo in /root

però a questo punto bisognerebbe modificare instascript per inviare il comando giusto al file che crea, e non modificare il file già creato. Corretto?
Se si, potrebbe essere un codice come questo da correggere nello script php:
Codice:
$example = str_replace('{DATABASE}', '"/var/www/vincisinstabot/web/'.$username.'.db"', $example);
oppure ho scritto una cazzata?
Cita messaggio
Sì, il codice che hai scritto è corretto.
Per gli script già creati, ti suggerisco di modificare a mano i file ".py" e di spostare i file dei database.
Mattia!
Cita messaggio
ok, corretto... vediamo se tutto procede correttamente... intanto però vedo che in /root vengono ancora creati i file "errors.log" e "follows_db.db" che si aggiornano in tempo reale... da dove si controlla la loro creazione secondo te?
Cita messaggio
Penso che siano file creati e aggiornati da tutti i i vecchi script e cron creati durante le prove che hai fatto per arrivare alla situazione attuale.
Mattia!
Cita messaggio
ok, quindi me ne posso sbattere trnquillamente? o esiste un modo per pulire i cron vecchi e processi vari?
Cita messaggio
Sarebbe meglio eliminare i cron che non servono.

Se puoi utilizzare la linea di comando, il seguente comando mostra tutti i cron attivi.
Codice:
crontab -l

Se ci sono cron da eliminare, il metodo più facile per farlo è cancellare le righe relative nel file di cron.
Utilizzando il comando seguente ti si aprirà il file di cron in un editor di testo.
Codice:
crontab -e
Mattia!
Cita messaggio
perfetto, ho ripulito il file temporaneo da tutti i cron attivi e ho ricreato solo quelli che mi servono (infatti non vengono più creati quei file nella cartella root). L'unica cosa di cui mi sono reso conto è che effettivamente, nel momento in cui creo un nuovo bot, setto il cron (alle 06.00 am), dico che al reboot deve ripartie, ma non dico che andrebbe anche avviato automaticamente nel momento in cui viene creato.
Cita messaggio
Per eseguire lo script al momento della creazione, dovresti eseguire lo script tramite exec dopo l'ultimo $crontab->append_cronjob.

Se utilizzi questo codice, dovrebbe venir eseguito lo script in background in modo che il PHP non debba aspettare la fine dell'esecuzione prima di continuare.
Codice PHP:
exec('/var/www/vincisinstabot/web/'.
$username.'.py > /dev/null &'); 

Se utilizzi questo codice, dovrebbe venir eseguito lo script salvando i messaggi nel file di log.
Codice PHP:
exec('/var/www/vincisinstabot/web/'.
$username.'.py >> /var/www/vincisinstabot/web/'.$username.'.log 2>&1'); 
Mattia!
Cita messaggio
quindi dovrebbe essere corretto il codice così:
Codice:
$crontab->append_cronjob('01 06 * * * /var/www/vincisinstabot/web/'.
$username.'.py >> /var/www/vincisinstabot/web/'.$username.'.log 2>&1');
$crontab->append_cronjob('@reboot /var/www/vincisinstabot/web/'.
$username.'.py >> /var/www/vincisinstabot/web/'.$username.'.log 2>&1');
exec('/var/www/vincisinstabot/web/'.
$username.'.py >> /var/www/vincisinstabot/web/'.$username.'.log 2>&1');
echo '<p>Creazione OK</p>';
come puoi vedere ho optato per l'esecuzione che salva su log
Cita messaggio
Sì, dovrebbe essere corretto. Naturalmente fai qualche prova.
Mattia!
Cita messaggio
mhmhhm qualcosa non funzica:
Citazione:sh: 1: /var/www/vincisinstabot/web/brandlandsicilia.py: Permission denied

inoltre mi sono reso conto anche del fatto che dalla pagina html della creazione del bot, indipendentemente dal fatto che inserisco correttamente i dati di un account instagram valido o anche finto, mi crea comunque il file .py, secondo te è possibile mettere un controllo che verifichi che l'account sia effettivamente valido e solo allora creare il bot .py?
Cita messaggio
Sembrerebbe che non abbia i permessi per eseguire lo script.
Al comando chmod metti come secondo parametro 0755.
Codice PHP:
chmod('percorso/del/file.py'0755); 
Mattia!
Cita messaggio
Fatto e sembra funzionare Smile
Grazie!

riguardo al controllo che verifica l'account?
e secondo me sarebbe figo mettere nella pagina monitor anche una funzione che mi permetta di eliminare i cron (così ogni volta non dovrei farlo direttamente da terminale)
Cita messaggio
Per verificare che l'username e la password di un account sono corrette potresti provare a utilizzare questa libreria in PHP (su questa pagina c'è la guida per utilizzarla).

Per eliminare un cron dovresti utilizzare il metodo remove_cronjob della classe PHP per gestire i cron job.
Mattia!
Cita messaggio


Discussioni simili
Discussione Autore Risposte Letto Ultimo messaggio
  script per generazione immagine da template Chandler 135 128.366 18-07-2015, 08:19
Ultimo messaggio: Mattia

Vai al forum:


Utenti che stanno guardando questa discussione: 1 Ospite(i)