smf33 / FlickrFollowerBot

Flickr Follower Bot : Bot for Flickr, in .Net Core, using a Chrome client and Selenium for command it
MIT License
12 stars 2 forks source link

Question about list of users with AddXxx params #2

Closed aurel2222 closed 4 years ago

aurel2222 commented 4 years ago

Hello, First, I would like to congratulate you for the big work you offered us.

I have a question, it is not an issue. I'm trying to learn programmation.

I would like to customize the use of your program. For instance, I would like to follow or unfollow people using a specific list. For now I understand the unfollow command is reading a queue coming from the task that refers the people who are not following.

My own criteria is different, I look the no active accounts to clean them from my following list. Is there a way to build my own list (I can do that manualy) and feed the unfollow command with ?

Sorry if i'm not very understandable !

Thanks for your help and take care for you and your family !

smf33 commented 4 years ago

Hi, Tx. Yes easily : the workflow is already made for this by using small task and queue (todo) between them. Here one task detect and add to the (un)follow queue (a « to do » so) and one task do the (un)follow.

So manually , use the AddContactsToFollow task and provide the url in the config, then use the DoFollow task. U can duplicate AddContactsToFollow for the unfollow, i may also, didn t until yet because disn t see the point :-)

By automatic code, duplicate and code a detect task that push to the good queue and keep the workflow following

If need an exemple tell we more on you conf (linux/win, directly run from dotnet with a local chrome, or in a docker or docker compose selenium server setup)

Good luck

Le sam. 4 avr. 2020 à 15:28, aurel2222 notifications@github.com a écrit :

Hello, First, I would like to congratulate you for the big work you offered us.

I have a question, it is not an issue. I'm trying to learn programmation.

I would like to customize the use of your program. For instance, I would like to follow or unfollow people using a specific list. For now I understand the unfollow command is reading a queue coming from the task that refers the people who are not following.

My own criteria is different, I look the no active accounts to clean them from my following list. Is there a way to build my own list (I can do that manualy) and feed the unfollow command with ?

Sorry if i'm not very understandable !

Thanks for your help and take care for you and your family !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/smf33/FlickrFollowerBot/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM3JO3XVQ2JIK3PYN722XALRK4YX7ANCNFSM4L6IEH6Q .

aurel2222 commented 4 years ago

Thanks for the quick answer. I'm working with windows with chrome on my pc, using a batch file. So I tried that : dotnet run AddContactsToFollow=https://www.flickr.com/people/{USERID} BotTasks=DoContactsUnfollow BotUserEmail=account@mail.com BotUserPassword=password

But, when trying it, it doesn't process the right UserID. It works an other userID, andthen go to a next ID to process it.

Where am I wrong ?

Thanks again !

PS : it is said : AddPhotosToFav useless for https://www.flickr.com/people/{userId}

smf33 commented 4 years ago

You added in the ToFollow queue then asked to do the UnFollow task, you should have run the DoContactsFollow task instead. Does it fix your param issue ?

Also, FYI, the AddContactsXX add at the bottom of the queue, so if you have already stuff to process already, you will have to process all the queue or ignore the queue (BotUsePersistence=0) or edit the .json user file (account@mail.com.json) that will be generated after first run.

I added the support of the AddContactsToUnfollow in last commit Here a full working exemple :

SET BotUserEmail=youraccount@mail.com
SET BotUserPassword=yourpassword
SET AddContactsToFollow=https://www.flickr.com/photos/chienvert/   
SET AddContactsToUnfollow=https://www.flickr.com/photos/chienvert/
SET BotTasks=DoContactsFollow,Pause,DoContactsUnfollow 
dotnet run

I didn't understant your point for AddPhotosToFav and the exemple you give is also KO : AddPhotosToFav => To use for faving one specific photo (https://www.flickr.com/photos/@user/@idphoto) AddContactsToFav => To use for faving between BotFavPictsPerContactMin and BotFavPictsPerContactMax photos of a user (https://www.flickr.com/photos/@user/)

aurel2222 commented 4 years ago

Thanks again. I tried exactly your working example, with two different accounts. It didn't work. Still working on it. I tried to change Does it fix your param issue ? unfortunately no. I don't understand why.

As you I don't understand why there is a message abou AddPhotosToFav because I don't try to fav, I try to follow or unfollow.

You added in the ToFollow queue then asked to do the UnFollow task, you should have run the DoContactsFollow task instead. it didn't work.

I have to work and try to understand exactly what is happening to avoir making you loose your time.

I even try to lauch it with a new 'installation' and so new .json file. Same problem.

I'll do a proper and clear test to share with you with all stages, and tell you the result.

Possible to write in french if you prefer.

thanks again !

smf33 commented 4 years ago

Ok, I checked more closely and find dumb bug in AddContactsToFollow and param loading (the cause of the AddPhotosToFav strange message). Could you get last sources and try again ?

You should get something like

Logged user :  https://www.flickr.com/people/{USERID}
$AddContactsToFollow +1 AddForced
$AddContactsToUnfollow +1 AddForced
SAVING USER JSON
aurel2222 commented 4 years ago

I downloaded th new version Unzipped it in a new directory Launched the working exemple from an test account. (10 followers / 1 following)

Chrome is opening Connection to the test account reading followers list going the 1st follower page, then following going to 2nd follwer page then following

I thought they were followers, but they are not. I think they are users I faved pictures... Because for now it followed 15 users, And the account has only 10 followers...

Here is the copy/paste of the command window :

LOADING...

LOADING USER JSON MyContacts : 1 MyContactsBanned : 0 ContactsToFollow : 398 > I can't explain that number ContactsToFav : 398 ContactsToUnfollow : 0 PhotosToFav : 456 Cookies : 22 NewChromeSeleniumWrapper(C:\Users.....\bin\Debug\netcoreapp3.1, 1710, 1298) Starting ChromeDriver 80.x.39xx.1xx (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882}) on port 5xx0x Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

DevTools listening on ws://1xx.0.0.1:5xxx5/devtools/browser/154f3a9e-3353-43f1-bbfa-a11bdcb2c77a

LOGGING...

GET https://www.flickr.com [1586036835.733][SEVERE]: Timed out receiving message from renderer: 0.100 GET https://www.flickr.com [1586036841.765][SEVERE]: Timed out receiving message from renderer: 0.100 Couldn't log user from cookie. Try normal auth GET /signin [1586036875.830][SEVERE]: Timed out receiving message from renderer: 0.100 WaitUrlStartsWith... Logged user : https://www.flickr.com/people/xxxxxx09@xxy GET https://www.flickr.com/people/aaaaaaa@Nxb/contacts [1586036891.286][SEVERE]: Timed out receiving message from renderer: 0.100 [13984:5488:0404/234813.726:ERROR:gcm_channel_status_request.cc(145)] GCM channel request failed. [13984:5488:0404/234839.924:ERROR:gcm_channel_status_request.cc(145)] GCM channel request failed. GET https://www.flickr.com/people/xxxxxxxx@xxxx/contacts/ignore AddPhotosToFav useless for https://www.flickr.com/photos/{testuser}/ SAVING USER JSON

RUNNING...

DOCONTACTSFOLLOW...

GET https://www.flickr.com/photos/13xxxxxxx@Nxx/ GET https://www.flickr.com/photos/bobyxxxxxxxxx/ etc.

aurel2222 commented 4 years ago

it finally followed 25 users. They are not all followers. Some followers were not followed. It didn't follow the test user.

I tried this which worked perfectly then : dotnet run BotTasks=DetectContactsUnfollowBack,DoContactsUnfollow otUserEmail=you@dom.com BotUserPassword=Passw0rd

It unfollowed till having : 10 followers and 8 followings (2 more unfollowed).

smf33 commented 4 years ago

You are almost there, just need to apply my previous advices and understand how this bot work. Then if you have some feedback on some point to add in the doc, in order to be more clear for a 1st time user, feel free to shoot :-)

1) get last sources I see "useless for" in your previous post, this message have been changed in latest yesterday commit, you can see this here https://github.com/smf33/FlickrFollowerBot/commit/d28d33d14d1aeb89693c6abe63099a63c09ced8a#diff-541bef3000dabc5856a1b617e1463252 Later you should do a "git clone" insteade of source zip download, in order to avoid losing your stuff next update (the git pull will get only the diff and keed your change if no conflit).

2) delete your user saved data file (a user@domain.json that is in the app folder by default) This will clear all the queue and what you will add by AddContactsToXxx will so be first to pop of the queue and be done. My guess is that you have run the bot once without BotTasks settings, and so the default actions have been done, including a scan of Today Explorer that have loaded theses 398 users to be followed.

Just in case if not clear, the task BotTasks are processed by batch, checks the FlickrFollowerBot.json for all theses settings For exemple DoContactsUnfollow will process between BotUnfollowTaskBatchMinLimit (20)and BotUnfollowTaskBatchMaxLimit (80) unfollow then end for this run.

aurel2222 commented 4 years ago

Ok, I think I get it. I do some tests and prepare a little explaination for documentation. thanks again and I give news.

aurel2222 commented 4 years ago

Well, as promised here is a little explaination for the one who would try to use the bot. Even if everything is said in the topic. 1) I advice user to use a batch file to write the command 2) the batch file could be like this to follow a list of users : cd/ cd {path to the bot} cls @echo off SET BotUserEmail=youraccount@mail.com SET BotUserPassword=yourpassword SET AddContactsToFollow=https://www.flickr.com/photos/{UserId1},https://www.flickr.com/photos/{UserId2},{.....} SET BotTasks=DoContactsFollow dotnet run pause 3)be careful to this file : C:{}patho to the bot\bin\Debug\netcoreapp3.1\PersistenceData{your.mail.com}_ It contains very interesting information to understand the bot actions. If you want to 'reset' the bot, delete this file. It allows to memorize the previous actions.

hope it will help !

PS for author 👍 : Merci pour le travail, j'ai pu mettre à jour pas mal de choses sur mon compte. J'avais abandonné flickr depuis un moment, et besoin de faire le ménage avant de reprendre les choses. Je vais essayer de comprendre le fonctionnement en C++ ou voir comment interfacer avec python... Mais ça, c'est pas pour maintenant !

aurel2222 commented 4 years ago

sorry i'm back. I'm using this command :

Dotnet run BotSearchKeywords="Paris" BotTasks=SearchKeywords,DoPhotosFav BotUserEmail=you@dom.com BotUserPassword=Passw0rd

I want to select pictures with a specific tag, then fav them without following.

The resusult is that : it doesn't give fav pictures with this tag but with other ones completely different.

I launch it again with a second word, for instance "Lyon". It doesn't fav pictures with this tag but other

After many (many) launches, I try with the word 'Marseilles'. Then it faves pictures of Paris... :-?

Is is like there was a queue in tags asked.

Once again I missed something I guess.

smf33 commented 4 years ago

Hi,

First, thanks for the previous feedback, i add some informations in today commit. Batch is usefull and most easy to manage with env variable (i use this with planned devops linux pipeline), but for 1st time user i may advice to edit directy the FlickrFollowerBot.json : adding the username and pass inside this file seems easy, and allow the user to discover all theses BotXXX settings.

For your latestest question, yes u got it :-) There is a queue system for each actions, so fav too. So you can remove your user saved json for reseting the queue, or remove data in the json directly, else wait the full queue is processed :-).

Btw , you may try to read the output log too and search the queue variable name in it (with a $ prefix for easy search) you sill see when the data are loaded from the file (#) addition (+) and sub (-) of element by tasks. If the URI are already in the queue, it s normal if there is no addition. You will see that some actions add to multiple queue. This can be changed by using some special name action, like searchkeywords_photosonly. you can check this at the top of followerbot.cs, there is all available task name.

Hope it s clear enough,

aurel2222 commented 4 years ago

Hi, Very clear. Indeed deleting in the Json entries made the work. Still studying.... ;) thanks for your help and wuick answers !

thinking about making a kind of interface, python or visual basic... still thinking about it. I'll tell you of i do something interesting.

smf33 commented 4 years ago

Welcome, yes sorry for the lazy doc, i wasn t sure it will interress lot of people , so i didn t spend much time on the doc. I m also a little more on the instagram bot than the flickr one now , flickr seems ... https://trends.google.com/trends/explore?hl=fr&tz=-120&date=all&q=%2Fm%2F04dtx9,%2Fm%2F0glpjll,%2Fm%2F0h3tm0f,%2Fm%2F0h961jr&sni=6

Good luck to you if you do an IHM :-)

Le mer. 15 avr. 2020 à 20:10, aurel2222 notifications@github.com a écrit :

Hi, Very clear. Indeed deleting in the Json entries made the work. Still studying.... ;) thanks for your help and wuick answers !

thinking about making a kind of interface, python or visual basic... still thinking about it. I'll tell you of i do something interesting.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/smf33/FlickrFollowerBot/issues/2#issuecomment-614195275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM3JO3QDNQIN5WHWQDBZ5NDRMX2ANANCNFSM4L6IEH6Q .