• R/O
  • SSH
  • HTTPS

instalikes: Commit


Commit MetaInfo

Revision14 (tree)
Zeit2020-06-18 01:44:11
Autorderekwildstar

Log Message

Ajustes para adequação ao novo KRAKATOA
Correção TEMPORÁRIA para resolver o problema do login com senhas criptografadas

Ändern Zusammenfassung

Diff

--- trunk/src/UConfigurations.pas (revision 13)
+++ trunk/src/UConfigurations.pas (revision 14)
@@ -3,7 +3,7 @@
33 interface
44
55 uses
6- KRK.Lib.Rtl.Common.Classes;
6+ KRK.Rtl.Common.Classes;
77
88 type
99 TConfigurations = class(TObjectFile)
--- trunk/src/UDAMOPrincipal.pas (revision 13)
+++ trunk/src/UDAMOPrincipal.pas (revision 14)
@@ -8,12 +8,12 @@
88 FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.VCLUI.Wait, Data.DB,
99 FireDAC.Comp.Client, System.ImageList, Vcl.ImgList, Vcl.Controls,
1010 UPngImageList, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf,
11- FireDAC.DApt, FireDAC.Comp.DataSet,
12- KRK.Components.AdditionalControls.BalloonHint, Vcl.ExtCtrls, Vcl.Menus,
11+ FireDAC.DApt, FireDAC.Comp.DataSet, Vcl.ExtCtrls, Vcl.Menus,
1312 Vcl.PlatformDefaultStyleActnCtrls, Vcl.ActnPopup, System.Actions,
14- Vcl.ActnList, Vcl.ActnMan, KRK.Components.DataControls.DBGrid, JSON,
13+ Vcl.ActnList, Vcl.ActnMan, KRK.Vcl.DBGrids, JSON,
1514 Vcl.Forms, FireDAC.Phys.MySQLDef, FireDAC.Phys.MySQL,
16- FireDAC.Comp.ScriptCommands, FireDAC.Stan.Util, FireDAC.Comp.Script, UFORMStatus;
15+ FireDAC.Comp.ScriptCommands, FireDAC.Stan.Util, FireDAC.Comp.Script, UFORMStatus,
16+ KRK.Vcl.Controls;
1717
1818 type
1919 TMedia = record
@@ -161,7 +161,7 @@
161161 procedure LikeLastMedia(const AKRKDBGridUser: TKRKDBGrid);
162162 procedure FollowUsers(const AKRKDBGridUser: TKRKDBGrid);
163163 function Follow(AUserId: String): TFollowResult;
164- procedure HandleModalResult(AInternalForm: TForm);
164+ procedure HandleModalResult(AInternalForm: TCustomForm);
165165 function LikeMedia(AMediaId: String; ALike: Boolean = True): Boolean;
166166 procedure GetFollowersPage(AUserId: String; var ANextPageToken: String; out AInstagramUsers: TInstagramUsers; out ATotalFollowers: Cardinal; AUsersPerPage: Byte = 50);
167167 // Obtém os dados atualizados do usuário, atualizando também as últimas
@@ -191,9 +191,9 @@
191191 implementation
192192
193193 uses
194- KRK.Lib.Rtl.Win.WinInet.Utilities, Windows, WinInet,
195- KRK.Lib.RegExp.Utils, NetEncoding, System.RegularExpressionsCore,
196- UFORMPrincipal, jpeg, KRK.Lib.Vcl.Forms.FormBlender, UFORMAddUserParams,
194+ KRK.Rtl.Win.WinInet.Utilities, Windows, WinInet,
195+ KRK.RegExp.Utils, NetEncoding, System.RegularExpressionsCore,
196+ UFORMPrincipal, jpeg, KRK.Vcl.Forms.FormBlender, UFORMAddUserParams,
197197 System.Generics.Collections, Math, UConfigurations, DateUtils;
198198
199199 {%CLASSGROUP 'Vcl.Controls.TControl'}
@@ -362,8 +362,7 @@
362362 begin
363363 TKRKFormBlender.ShowMe(FORMPrincipal,TFORMStatus,FB);
364364 try
365- while not FB.InternalFormVisible do
366- Application.ProcessMessages;
365+ FB.WaitForInternalForm;
367366
368367 FS := TFORMStatus(FB.InternalFormInstance);
369368 FS.LABETitle.Caption := 'Adding user...';
@@ -698,7 +697,7 @@
698697 end;
699698 end;
700699
701-procedure TDAMOPrincipal.HandleModalResult(AInternalForm: TForm);
700+procedure TDAMOPrincipal.HandleModalResult(AInternalForm: TCustomForm);
702701 begin
703702 FAddFollowersParams := TFORMAddUserParams(AInternalForm).AddFollowersParams;
704703 end;
@@ -713,7 +712,9 @@
713712 procedure TDAMOPrincipal.ACTNAddFollowersExecute(Sender: TObject);
714713 begin
715714 if FDTAUser.RecordCount > 0 then
716- if TKRKFormBlender.ShowMe(FORMPrincipal,TFORMAddUserParams,HandleModalResult) = mrOk then
715+ if TKRKFormBlender.ShowMe(FORMPrincipal
716+ ,TFORMAddUserParams
717+ ,HandleModalResult) = mrOk then
717718 begin
718719 AddFollowers(FDTAUserid.AsString,FAddFollowersParams);
719720
@@ -869,8 +870,7 @@
869870
870871 TKRKFormBlender.ShowMe(FORMPrincipal,TFORMStatus,FB);
871872 try
872- while not FB.InternalFormVisible do
873- Application.ProcessMessages;
873+ FB.WaitForInternalForm;
874874
875875 FS := TFORMStatus(FB.InternalFormInstance);
876876 FS.LABETitle.Caption := 'Getting followers...';
@@ -1569,7 +1569,14 @@
15691569 // RO.HttpOpenRequestParams.Headers.Add('rur: ' + HeaderValue(FRUR));
15701570 // RO.HttpOpenRequestParams.Headers.Add('urlgen: ' + HeaderValue(FURLGen));
15711571 // RO.HttpOpenRequestParams.Headers.Add('x-csrftoken: ' + HeaderValue(FCSRFToken));
1572- RO.Content := TStringStream.Create('username=' + AUserName +'&password=' + APassword + '&queryParams=%7B%7D');
1572+ // Em 17/06 descobri que as senhas agora precisam ser encriptadas. Passou-se
1573+ // a usar enc_password com aquele valor estranho que se pode ver abaixo,
1574+ // porém, ao invés da senha crua (como eu estou usando), o original usava
1575+ // algo encriptado. A dica de uso eu consegui em https://github.com/pgrimaud/instagram-user-feed/commit/96ad4cf54d1ad331b337f325c73e664999a6d066
1576+ // Novamente não sei quanto tempo isso vai durar, principalmente neste caso,
1577+ // porque isso parece uma gambiarra. Por ora funciona
1578+ // RO.Content := TStringStream.Create('username=' + AUserName +'&password=' + APassword + '&queryParams=%7B%7D');
1579+ RO.Content := TStringStream.Create('username=' + AUserName +'&enc_password=#PWD_INSTAGRAM_BROWSER:0:' + DateTimeToUnix(Now).ToString + ':' + APassword + '&queryParams=%7B%7D');
15731580
15741581 Screen.Cursor := crHourGlass;
15751582 try
@@ -1776,8 +1783,7 @@
17761783 begin
17771784 TKRKFormBlender.ShowMe(TForm(AKRKDBGridUser.Owner),TFORMStatus,FB);
17781785 try
1779- while not FB.InternalFormVisible do
1780- Application.ProcessMessages;
1786+ FB.WaitForInternalForm;
17811787
17821788 FS := TFORMStatus(FB.InternalFormInstance);
17831789 FS.LABETitle.Caption := 'Following users...';
@@ -1836,8 +1842,7 @@
18361842 begin
18371843 TKRKFormBlender.ShowMe(TForm(AKRKDBGridUser.Owner),TFORMStatus,FB);
18381844 try
1839- while not FB.InternalFormVisible do
1840- Application.ProcessMessages;
1845+ FB.WaitForInternalForm;
18411846
18421847 FS := TFORMStatus(FB.InternalFormInstance);
18431848 FS.LABETitle.Caption := 'Liking medias...';
--- trunk/src/UFORMPrincipal.pas (revision 13)
+++ trunk/src/UFORMPrincipal.pas (revision 14)
@@ -6,7 +6,7 @@
66 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
77 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.ExtCtrls,
88 Vcl.Imaging.pngimage, System.ImageList, Vcl.ImgList, UPngImageList, Data.DB,
9- Vcl.Grids, Vcl.DBGrids, KRK.Components.DataControls.DBGrid, Vcl.Buttons,
9+ Vcl.Grids, Vcl.DBGrids, KRK.Vcl.DBGrids, Vcl.Buttons,
1010 UPngBitBtn, UPngSpeedButton, UDAMOPrincipal, Vcl.DBCtrls, Vcl.Imaging.jpeg;
1111
1212 type
@@ -91,7 +91,7 @@
9191 implementation
9292
9393 uses
94- KRK.Lib.Rtl.Win.WinInet.Utilities, Winapi.WinInet, JSON, NetEncoding, CommCtrl;
94+ KRK.Rtl.Win.WinInet.Utilities, Winapi.WinInet, JSON, NetEncoding, CommCtrl;
9595
9696 {$R *.dfm}
9797
Show on old repository browser