-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBGDDW2C14B17
1034 lines (788 loc) · 61.5 KB
/
BGDDW2C14B17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
rem set pia=BGDD
rem set pia1=BGDD1
set pia=%fileno:~0,4%
set pia1=%fileno:~0,4%1
set fileno=%fileno:~0,12%
set fileno=%fileno: =%
set birthdate=%birthdate: =%
set passport_no=%passport_no: =%
echo ##################################################################
echo ++++ pia ============ %pia% ++++++++++ pia1 =========== %pia1%
echo -----------------------------------------------------------------
echo ++++ fileno ========= "%fileno%"
echo ++++ APPLNAME ======= "%APPLNAME%"
echo ++++ birthdate ====== "%birthdate%"
echo ++++ passport_no ==== "%passport_no%"
echo ##################################################################
echo ##################################################################
:StartBegin
SET /a try=0
SET /a sn=0
SET /a useProxy=0
SET /a usedante=0
SET /a difftime=1200
SET /a otp=nootp
SET /a captchatry=0
SET /a status=X
SET socks5=
SET /a cn=%RANDOM%*8/32768
SET /a rn=%RANDOM%*20/32768
SET /a _rand=%RANDOM%*100/32768+151
SET /a sessionstatus=0
SET /a ms=%RANDOM%*98/32768+1
SET ivacTime=11:36:10.%ms%
TITLE IVAC %~n0 ##%fileno%##%APPLNAME%##%pia%##CN : %cn% _ RN: %rn% _ TRY : %try%
echo ****************** **************** ****************** >> %fileno%-report.txt
echo ****************** START FROM BEGIN ****************** >> %fileno%-report.txt
echo ****************** **************** ****************** >> %fileno%-report.txt
echo ****************** **************** ****************** >> %fileno%-log.txt
echo ****************** START FROM BEGIN ****************** >> %fileno%-log.txt
echo ****************** **************** ****************** >> %fileno%-log.txt
call :checktime
if /i %tls% GTR 16000 goto Begin_Get_Appointment
timeout %tls%
goto Begin_Get_Appointment
echo ****************** Technical Problem at Line Number 130 ****************** >> %fileno%-error.txt
:Begin_Get_Appointment
rem from above and
color 02
call :ColorText 20 "Code 02 Black Braground Green Text"
fc /l %fileno%_cookie.txt %fileno%_savecookie.txt
if /i %ERRORLEVEL% EQU 0 goto runexist
TITLE IVAC %~n0 ## STEP1 _ Begin_Get_Appointment _ CN : %cn% _ RN: %rn% _ TRY : %try%
SET /a _rand=%RANDOM%*100/32768+151 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
c:\curl\curl%cn% --fail --silent --show-error --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" http://muslimbi.com/ivac/allotmentsave/show.php?passport_no=%passport_no% -o %fileno%-status.txt -w "Check Allotment Save Status \n"
IF EXIST "%fileno%-status.txt" FOR /F %%d IN (%fileno%-status.txt) DO SET status=%%d
IF EXIST "%fileno%-status.txt" del %fileno%-status.txt
SET status=%status:~0,1%
IF /i %status% EQU Y color 09 & echo File Already Taken & timeout 2 & goto pdfdownload
rem delete temp file if exist
IF EXIST "%fileno%-AppointmentField1.jpg" del %fileno%-AppointmentField1.jpg
IF EXIST "%fileno%-AppointmentField2.jpg" del %fileno%-AppointmentField2.jpg
IF EXIST "%fileno%-AppointmentCaptcha.jpg" del %fileno%-AppointmentCaptcha.jpg
goto Load_Get_Appointment
:runexist
findstr /c:"textBoxDashed" %fileno%-Appointment.txt > %fileno%-AppointmentVars.txt
@echo off & setlocal EnableDelayedExpansion
for /F "delims=" %%j in ('type "%fileno%-AppointmentVars.txt"') do (
set /A counter+=1
if !counter! equ 1 (echo.%%j> "%fileno%-Appointment_firstvar1.txt")
if !counter! equ 1 (echo.%%j>> "%fileno%-log.txt")
if !counter! equ 1 (echo.%%j>> "%fileno%-report.txt")
if !counter! equ 2 (echo.%%j> "%fileno%-Appointment_secondvar1.txt")
if !counter! equ 2 (echo.%%j>> "%fileno%-log.txt")
if !counter! equ 2 (echo.%%j>> "%fileno%-report.txt")
)
:END
endlocal
if exist "%fileno%-AppointmentVars.txt" del %fileno%-AppointmentVars.txt
FOR /F "usebackq tokens=3" %%m IN (%fileno%-Appointment_firstvar1.txt) DO SET firstvar=%%m
set firstvar=%firstvar:~6,6%
echo %firstvar%| findstr /r "^[0-9]*$"
if errorlevel 1 echo "First Variable NOT Number" & start %fileno%-Appointment_firstvar1.txt & set /p firstvar=Enter First Variable
if exist "%fileno%-Appointment_firstvar1.txt" del %fileno%-Appointment_firstvar1.txt
FOR /F "usebackq tokens=3" %%n IN (%fileno%-Appointment_secondvar1.txt) DO SET secondvar=%%n
set secondvar=%secondvar:~6,6%
echo %secondvar%| findstr /r "^[0-9]*$"
if errorlevel 1 echo "Second Variable NOT Number" & start %fileno%-Appointment_secondvar1.txt & set /p secondvar=Enter Second Variable
if exist "%fileno%-Appointment_secondvar1.txt" del %fileno%-Appointment_secondvar1.txt
findstr /c:"token" %fileno%-Appointment.txt > %fileno%-Appointment_token.txt
FOR /F "usebackq tokens=4" %%n IN (%fileno%-Appointment_token.txt) DO SET tokenvar=%%n
set tokenvar=%tokenvar:~7,36%
if exist "%fileno%-Appointment_token.txt" del %fileno%-Appointment_token.txt
echo Appointment Token = "%tokenvar%"
echo %tokenvar%| findstr /r "^[a-z0-9!-]*$"
call :getFilesize "%fileno%-AppointmentField1.jpg"
if /i %filesize% EQU 1631 SET firstvalue=%fathername%& SET filecontent1="Father's Name"
if /i %filesize% EQU 1644 SET firstvalue=%mothername%& SET filecontent1="Mother's Name"
if /i %filesize% EQU 2307 SET firstvalue=%givenname%& SET filecontent1="Fiven Name"
if /i %filesize% EQU 1352 SET firstvalue=%birthplace%& SET filecontent1="Place of Birth"
if /i %filesize% EQU 1512 SET firstvalue=%fathername%& SET filecontent1="Father's Name"
if /i %filesize% EQU 1587 SET firstvalue=%mothername%& SET filecontent1="Mother's Name"
if /i %filesize% EQU 2155 SET firstvalue=%givenname%& SET filecontent1="Fiven Name"
if /i %filesize% EQU 1312 SET firstvalue=%birthplace%& SET filecontent1="Place of Birth"
if "%firstvalue%"=="" call :entryvalue DDF1
echo file size is %filesize% and file content is %filecontent1%="%firstvalue%"
call :getFilesize "%fileno%-AppointmentField2.jpg"
if /i %filesize% EQU 1631 SET secondvalue=%fathername%& SET filecontent2="Father's Name"
if /i %filesize% EQU 1644 SET secondvalue=%mothername%& SET filecontent2="Mother's Name"
if /i %filesize% EQU 2307 SET secondvalue=%givenname%& SET filecontent2="Fiven Name"
if /i %filesize% EQU 1352 SET secondvalue=%birthplace%& SET filecontent2="Place of Birth"
if /i %filesize% EQU 1512 SET secondvalue=%fathername%& SET filecontent2="Father's Name"
if /i %filesize% EQU 1587 SET secondvalue=%mothername%& SET filecontent2="Mother's Name"
if /i %filesize% EQU 2155 SET secondvalue=%givenname%& SET filecontent2="Fiven Name"
if /i %filesize% EQU 1312 SET secondvalue=%birthplace%& SET filecontent2="Place of Birth"
if "%secondvalue%"=="" call :entryvalue DDF2
echo file size is %filesize% and file content is %filecontent2%="%secondvalue%"
echo First Variable = "%firstvar%" & echo First Variable = "%firstvar%" >> %fileno%-report.txt
echo First Value %filecontent1% = "%firstvalue%" & echo First Value %filecontent1% = "%firstvalue%" >> %fileno%-report.txt
echo Second Variable = "%secondvar%" & echo Second Variable = "%secondvar%" >> %fileno%-report.txt
echo Second Value %filecontent2% = "%secondvalue%" &echo Second Value %filecontent2% = "%secondvalue%" >> %fileno%-report.txt
goto sessionupdate
:Load_Get_Appointment
TITLE IVAC %~n0 ## STEP1 _ Load_Get_Appointment _ CN : %cn% _ RN: %rn% _ TRY : %try%
SET /a try+=1
if /i %try% GTR 3 SET /a _rand=%RANDOM%*100/32768+151 & set /a try=0 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
c:\curl\curl%cn% -v --trace-time -S -d -e --connect-timeout 4 -m 15 -b otpcookie%rn%.txt -c %fileno%_cookie.txt -H "Keep-Alive: 60" -H "Connection: keep-alive" --dump-header %fileno%-Appointment_headers1.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/index.html http://indianvisa-bangladesh.nic.in/visa/Get_Appointment -L -o %fileno%-Appointment.txt -w "STEP ONE.ONE Appointment_Login OTP Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
findstr /L /O /N /C:"HTTP/1.1 200 OK" %fileno%-Appointment_headers1.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Load_Get_Appointment "HTTP/1.1 200 OK" Load_Get_Appointment200 & goto Load_Get_Appointment200
findstr /L /O /N /C:"HTTP/1.1 200" %fileno%-Appointment_headers1.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Load_Get_Appointment "HTTP/1.1 200" Load_Get_Appointment200 & goto Load_Get_Appointment200
findstr /L /O /N /C:"HTTP/1.1 404 Not Found" %fileno%-Appointment_headers1.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Load_Get_Appointment "HTTP/1.1 404 Not Found" Begin_Get_Appointment & goto Begin_Get_Appointment
findstr /L /O /N /C:"HTTP/1.1 302 Moved Temporarily" %fileno%-Appointment_headers1.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Load_Get_Appointment "HTTP/1.1 302 Moved Temporarily" Begin_Get_Appointment & goto Begin_Get_Appointment
findstr /L /O /N /C:"HTTP/1.1 307 Temporary Redirect" %fileno%-Appointment_headers1.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Load_Get_Appointment "HTTP/1.1 307 Temporary Redirect" Load_Get_Appointment & goto Load_Get_Appointment
call :logprint Load_Get_Appointment "SERVER BUSY on STEP ONE.ONE === Retry Again" Load_Get_Appointment
if /i %try% EQU 30 set try=0 & goto Begin_Get_Appointment
goto Load_Get_Appointment
echo ****************** Technical Problem at Line Number 175 ****************** >> %fileno%-error.txt
:Load_Get_Appointment200
findstr /L /O /N /C:"The Problem may be due to 500 Server Error/404 Page Not Found" %fileno%-Appointment.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Load_Get_Appointment200 "The Problem may be due to 500 Server Error/404 Page Not Found" Load_Get_Appointment & goto Load_Get_Appointment
findstr /L /O /N /C:"Appointment not started.Please try again after some time" %fileno%-Appointment.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Load_Get_Appointment200 "Appointment not started.Please try again after some time" StartBegin & timeout 2 & goto StartBegin
findstr /L /O /N /C:"Connection: Close" %fileno%-Appointment_headers1.txt
if /i %ERRORLEVEL% EQU 0 call :captchaenable & goto Load_Get_Appointment
color 0E
call :ColorText E0 "Code 0E Black Braground Light Yellow Text"
findstr /c:"textBoxDashed" %fileno%-Appointment.txt > %fileno%-AppointmentVars.txt
@echo off & setlocal EnableDelayedExpansion
for /F "delims=" %%j in ('type "%fileno%-AppointmentVars.txt"') do (
set /A counter+=1
if !counter! equ 1 (echo.%%j> "%fileno%-Appointment_firstvar1.txt")
if !counter! equ 1 (echo.%%j>> "%fileno%-log.txt")
if !counter! equ 1 (echo.%%j>> "%fileno%-report.txt")
if !counter! equ 2 (echo.%%j> "%fileno%-Appointment_secondvar1.txt")
if !counter! equ 2 (echo.%%j>> "%fileno%-log.txt")
if !counter! equ 2 (echo.%%j>> "%fileno%-report.txt")
)
:END
endlocal
if exist "%fileno%-AppointmentVars.txt" del %fileno%-AppointmentVars.txt
FOR /F "usebackq tokens=3" %%m IN (%fileno%-Appointment_firstvar1.txt) DO SET firstvar=%%m
set firstvar=%firstvar:~6,6%
echo %firstvar%| findstr /r "^[0-9]*$"
if errorlevel 1 echo "First Variable NOT Number" & start %fileno%-Appointment_firstvar1.txt & set /p firstvar=Enter First Variable
if exist "%fileno%-Appointment_firstvar1.txt" del %fileno%-Appointment_firstvar1.txt
FOR /F "usebackq tokens=3" %%n IN (%fileno%-Appointment_secondvar1.txt) DO SET secondvar=%%n
set secondvar=%secondvar:~6,6%
echo %secondvar%| findstr /r "^[0-9]*$"
if errorlevel 1 echo "Second Variable NOT Number" & start %fileno%-Appointment_secondvar1.txt & set /p secondvar=Enter Second Variable
if exist "%fileno%-Appointment_secondvar1.txt" del %fileno%-Appointment_secondvar1.txt
findstr /c:"token" %fileno%-Appointment.txt > %fileno%-Appointment_token.txt
FOR /F "usebackq tokens=4" %%n IN (%fileno%-Appointment_token.txt) DO SET tokenvar=%%n
set tokenvar=%tokenvar:~7,36%
if exist "%fileno%-Appointment_token.txt" del %fileno%-Appointment_token.txt
echo Appointment Token = "%tokenvar%"
echo %tokenvar%| findstr /r "^[a-z0-9!-]*$"
if errorlevel 1 start %fileno%-Appointment_token.txt & echo "Appointment Token Variable Missing!!!!!! Enter Appointment Token Variable" & set /p tokenvar=
:Load_DisplayDynamicField1
SET filecontent1=& SET firstvalue=
TITLE IVAC %~n0 ## STEP1 _ Load_DisplayDynamicField1 _ CN : %cn% _ RN: %rn% _ TRY : %try%
c:\curl\curl%cn% -v --trace-time -S -d -e --connect-timeout 4 -m 10 -b %fileno%_cookie.txt -c %fileno%_cookie.txt -H "Keep-Alive: 60" -H "Connection: keep-alive" --dump-header %fileno%-AppointmentField1header.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/index.html http://indianvisa-bangladesh.nic.in/visa/DisplayDynamicField1 -L -o %fileno%-AppointmentField1.jpg -w "STEP ONE.ONE DisplayDynamicField1 OTP Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
if exist "%fileno%-AppointmentField1.jpg" ( call :getFilesize "%fileno%-AppointmentField1.jpg" ) else ( goto Load_DisplayDynamicField1 )
findstr /L /O /N /C:"Content-Type: text/html" %fileno%-AppointmentField1header.txt
if /i %ERRORLEVEL% EQU 0 goto Load_DisplayDynamicField1
if /i %filesize% EQU 1631 SET firstvalue=%fathername%& SET filecontent1="Father's Name"
if /i %filesize% EQU 1644 SET firstvalue=%mothername%& SET filecontent1="Mother's Name"
if /i %filesize% EQU 2307 SET firstvalue=%givenname%& SET filecontent1="Fiven Name"
if /i %filesize% EQU 1352 SET firstvalue=%birthplace%& SET filecontent1="Place of Birth"
if /i %filesize% EQU 1512 SET firstvalue=%fathername%& SET filecontent1="Father's Name"
if /i %filesize% EQU 1587 SET firstvalue=%mothername%& SET filecontent1="Mother's Name"
if /i %filesize% EQU 2155 SET firstvalue=%givenname%& SET filecontent1="Fiven Name"
if /i %filesize% EQU 1312 SET firstvalue=%birthplace%& SET filecontent1="Place of Birth"
if "%firstvalue%"=="" call :entryvalue DDF1
echo file size is %filesize% and file content is %filecontent1%="%firstvalue%"
:Load_DisplayDynamicField2
SET filecontent2=& SET secondvalue=
TITLE IVAC %~n0 ## STEP1 _ Load_DisplayDynamicField2 _ CN : %cn% _ RN: %rn% _ TRY : %try%
c:\curl\curl%cn% -v --trace-time -S -d -e --connect-timeout 4 -m 10 -b %fileno%_cookie.txt -c %fileno%_cookie.txt -H "Keep-Alive: 60" -H "Connection: keep-alive" --dump-header %fileno%-AppointmentField2header.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/index.html http://indianvisa-bangladesh.nic.in/visa/DisplayDynamicField2 -L -o %fileno%-AppointmentField2.jpg -w "STEP ONE.ONE DisplayDynamicField2 OTP Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
if exist "%fileno%-AppointmentField2.jpg" ( call :getFilesize "%fileno%-AppointmentField2.jpg" ) else ( goto Load_DisplayDynamicField2 )
findstr /L /O /N /C:"Content-Type: text/html" %fileno%-AppointmentField2header.txt
if /i %ERRORLEVEL% EQU 0 goto Load_DisplayDynamicField2
if /i %filesize% EQU 1631 SET secondvalue=%fathername%& SET filecontent2="Father's Name"
if /i %filesize% EQU 1644 SET secondvalue=%mothername%& SET filecontent2="Mother's Name"
if /i %filesize% EQU 2307 SET secondvalue=%givenname%& SET filecontent2="Fiven Name"
if /i %filesize% EQU 1352 SET secondvalue=%birthplace%& SET filecontent2="Place of Birth"
if /i %filesize% EQU 1512 SET secondvalue=%fathername%& SET filecontent2="Father's Name"
if /i %filesize% EQU 1587 SET secondvalue=%mothername%& SET filecontent2="Mother's Name"
if /i %filesize% EQU 2155 SET secondvalue=%givenname%& SET filecontent2="Fiven Name"
if /i %filesize% EQU 1312 SET secondvalue=%birthplace%& SET filecontent2="Place of Birth"
if "%secondvalue%"=="" call :entryvalue DDF2
echo file size is %filesize% and file content is %filecontent2%="%secondvalue%"
echo First Variable = "%firstvar%" & echo First Variable = "%firstvar%" >> %fileno%-report.txt
echo First Value %filecontent1% = "%firstvalue%" & echo First Value %filecontent1% = "%firstvalue%" >> %fileno%-report.txt
echo Second Variable = "%secondvar%" & echo Second Variable = "%secondvar%" >> %fileno%-report.txt
echo Second Value %filecontent2% = "%secondvalue%" &echo Second Value %filecontent2% = "%secondvalue%" >> %fileno%-report.txt
copy %fileno%_cookie.txt %fileno%_savecookie.txt
:Load_Get_Appointment_captcha
TITLE IVAC %~n0 ## STEP1 _ Load_Get_Appointment_captcha _ CN : %cn% _ RN: %rn% _ TRY : %try%
SET /a cn=%RANDOM%*8/32768
call :ColorText 0C "curl version %cn%"
SET /a try+=1
if /i %try% GTR 3 SET /a _rand=%RANDOM%*100/32768+151 & set /a try=0 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
c:\curl\curl%cn% -v --trace-time -S -d -e --connect-timeout 3 -m 10 -b %fileno%_cookie.txt -c %fileno%_cookie.txt --dump-header %fileno%-AppointmentCaptchaHeader.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/Get_Appointment http://indianvisa-bangladesh.nic.in/visa/captcha -o %fileno%-AppointmentCaptcha.jpg -w "STEP APPOINTMENT CAPTCHA Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
if not exist "%fileno%-AppointmentCaptcha.jpg" goto Load_Get_Appointment_captcha
echo ********************** STEP OTPCAPTCHA ****** Done by IP %_rand% _ time %time% _ SN: %sn% _ TRY : %try% ************************* >> %fileno%-report.txt
findstr /L /O /N /C:"Content-Type: text/html" %fileno%-AppointmentCaptchaHeader.txt
if /i %ERRORLEVEL% EQU 0 call :captchaenable & goto Load_Get_Appointment_captcha
findstr /L /O /N /C:"Content-Type: image/jpeg" %fileno%-AppointmentCaptchaHeader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Load_Get_Appointment_captcha "Content-Type: image/jpeg" sessionupdate & goto sessionupdate
call :logprint Load_Get_Appointment_captcha "SERVER BUSY on STEP APPOINTMENT CAPTCHA === Retry Again" Load_Get_Appointment_captcha
goto Load_Get_Appointment_captcha
:sessionupdate
echo ****************** STEP sessionupdate ****************** >> %fileno%-report.txt
echo ****************** STEP sessionupdate ****************** >> %fileno%-log.txt
if not exist "%fileno%-AppointmentCaptcha.jpg" goto Load_Get_Appointment_captcha
fc /l %fileno%_cookie.txt %fileno%_savecookie.txt
if /i %ERRORLEVEL% EQU 0 call :logprint sessionupdate "Cookie OK and Updated" & call :ColorText 02 "Cookie OK and Updated"
if /i %ERRORLEVEL% EQU 1 call :logprint sessionupdate "Cookie are different" & call :ColorText 0C "Cookie are different" & goto StartBegin
rem cookie updated different time code here
call :checktime
if /i %tls% GTR 60000 goto retriveotpcode
if /i %tls% GTR 300 timeout 60 & goto Load_Get_Appointment_captcha
:retriveotpcode
echo ****************** STEP retriveotpcode ****************** >> %fileno%-report.txt
echo ****************** STEP retriveotpcode ****************** >> %fileno%-log.txt
echo ####### Start Appointment Captcha Value on time %time% ####### %appointmentcaptcha% ####### %ImgNum2% ####### >> %fileno%-report.txt
c:\curl\curl -S -F "source_url=" -F "captcha_platform=" -F "action=Submit" -F "file=@%fileno%-AppointmentCaptcha.jpg" http://122.144.12.253:8181/gsa_test.gsa -o %fileno%-code.txt
FOR /F "tokens=11 delims=<\/>" %%m IN (%fileno%-code.txt) DO del %fileno%-AppointmentCaptcha.jpg & SET appointmentcaptcha=%%m
echo ####### End Appointment Captcha Value on time %time% ####### %appointmentcaptcha% ####### %ImgNum2% ####### >> %fileno%-report.txt
call :ColorText EC "Please Enter Appointment Captcha Value" & set /p appointmentcaptcha=
echo First Variable = "%firstvar%" & echo First Variable = "%firstvar%" >> %fileno%-report.txt
echo First Value %filecontent1% = "%firstvalue%" & echo First Value %filecontent1% = "%firstvalue%" >> %fileno%-report.txt
echo Second Variable = "%secondvar%" & echo Second Variable = "%secondvar%" >> %fileno%-report.txt
echo Second Value %filecontent2% = "%secondvalue%" &echo Second Value %filecontent2% = "%secondvalue%" >> %fileno%-report.txt
echo Appointment captcha Value = "%appointmentcaptcha%" & echo Appointment captcha Value = "%appointmentcaptcha%" >> %fileno%-report.txt
echo Token Value = "%tokenvar%" & echo Token Value = "%tokenvar%" >> %fileno%-report.txt
call :checktime
if /i %tls% GTR 16000 goto Check_Have_OTP
timeout %tls%
set try=0
:Check_Have_OTP
echo. >> %fileno%-log.txt
echo. >> %fileno%-log.txt
echo *********** Check Have any OTP ********* >> %fileno%-log.txt
echo. >> %fileno%-log.txt
echo. >> %fileno%-log.txt
TITLE IVAC %~n0 ## STEP1 _ Check_Have_OTP _ CN : %cn% _ RN: %rn% _ TRY : %try%
c:\curl\curl%cn% -sS --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" http://muslimbi.com/ivac/otp/difftime.php?fileno=%fileno% -o %fileno%-difftime.txt -w "Check difftime Save Status \n"
IF EXIST "%fileno%-difftime.txt" FOR /F %%d IN (%fileno%-difftime.txt) DO SET difftime=%%d
IF EXIST "%fileno%-difftime.txt" del %fileno%-difftime.txt
IF /i %difftime% EQU nootp goto BeginGenerateOTP
IF /i %difftime% GTR 800 goto curl_send_alotment_sms
c:\curl\curl%cn% --fail --silent --show-error --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" http://muslimbi.com/ivac/otp/show.php?fileno=%fileno% -o %fileno%-otp.txt -w "Check OTP Save Status \n"
FOR /F %%o IN (%fileno%-otp.txt) DO SET otp=%%o
IF EXIST "%fileno%-otp.txt" del %fileno%-otp.txt
IF /i %otp% EQU nootp goto BeginGenerateOTP
echo *********** OTP GENERATED by Another Script %difftime% ********* >> %fileno%-report.txt
call :logprint Check_Have_OTP "OTP GENERATED OTP "%otp% by Another Script at %difftime% sec ago" Begin_have_otp
goto Begin_have_otp
:BeginGenerateOTP
echo ****************** STEP BeginGenerateOTP ****************** >> %fileno%-report.txt
echo ****************** STEP BeginGenerateOTP ****************** >> %fileno%-log.txt
color 0E
call :ColorText E0 "Code 0E Black Braground Light Yellow Text"
goto curlGenerateOTP
:curlGenerateOTP
TITLE IVAC %~n0 ## STEP3 _ curlGenerateOTP _ CN : %cn% _ RN: %rn% _ TRY : %try%
echo ###################### STEP curlGenerateOTP curl version %cn% _ time %time% _ RN: %rn% _ TRY : %try% ################## >> %fileno%-report.txt
SET /a try+=1
if /i %try% GTR 3 SET /a _rand=%RANDOM%*100/32768+151 & set /a try=0 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
echo ****************** STEP curlGenerateOTP ****************** >> %fileno%-report.txt
echo ****************** STEP curlGenerateOTP ****************** >> %fileno%-log.txt
c:\curl\curl%cn% -v --trace-time -S -d -e --connect-timeout 4 -m 10 -b %fileno%_cookie.txt -c %fileno%_cookie.txt -d "filerfno=%fileno%&passport_number=%passport_no%&value1=%firstvalue%&value2=%secondvalue%&otp_required=generate_otp&otp=&captcha=%appointmentcaptcha%" -H "Keep-Alive: 60" -H "Connection: keep-alive" --dump-header %fileno%-GenerateOTPheader.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/Get_Appointment http://indianvisa-bangladesh.nic.in/visa/json/GenerateOtp -L -o %fileno%-GenerateOTP.txt -w "STEP TWO.ONE GenerateOTP Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
echo ********************** STEP TWO.ONE ****** Done by IP %_rand% _ time %time% _ RN: %rn% _ TRY : %try% ************************* >> %fileno%-report.txt
echo *********************************************************************************************** >> %fileno%-report.txt
findstr /L /O /N /C:"HTTP/1.1 200 OK" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curlGenerateOTP "HTTP/1.1 200 OK" GenerateOTP200 & goto GenerateOTP200
findstr /L /O /N /C:"HTTP/1.1 200" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curlGenerateOTP "HTTP/1.1 200" GenerateOTP200 & goto GenerateOTP200
findstr /L /O /N /C:"HTTP/1.1 404 Not Found" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curlGenerateOTP "HTTP/1.1 404 Not Found" Load_Get_Appointment & goto Load_Get_Appointment
findstr /L /O /N /C:"HTTP/1.1 408 Request Timeout" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curlGenerateOTP "HTTP/1.1 408 Request Timeout" curlGenerateOTP & goto curlGenerateOTP
findstr /L /O /N /C:"HTTP/1.1 302 Moved Temporarily" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curlGenerateOTP "HTTP/1.1 302 Moved Temporarily" GenerateOTP302 & goto GenerateOTP302
findstr /L /O /N /C:"HTTP/1.1 307 Temporary Redirect" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curlGenerateOTP "HTTP/1.1 302 Moved Temporarily" GenerateOTP302 & goto GenerateOTP302
findstr /L /O /N /C:"Content-Type: application/json" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curlGenerateOTP "Content-Type: application/json" GenerateOTP200 & goto GenerateOTP200
call :logprint curlGenerateOTP "SERVER BUSY on STEP curlGenerateOTP === Retry Again" curlGenerateOTP
if /i %try% EQU 200 set try=0 & goto Load_Get_Appointment
goto curlGenerateOTP
echo ****************** Technical Problem at Line Number 305 ****************** >> %fileno%-error.txt
:GenerateOTP200
echo ****************** STEP GenerateOTP200 ****************** >> %fileno%-report.txt
echo ****************** STEP GenerateOTP200 ****************** >> %fileno%-log.txt
findstr /L /O /N /C:"The Problem may be due to 500 Server Error/404 Page Not Found" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 echo ====== Error Level is %ERRORLEVEL% for ===500 Server Error/404 Page Not Found=== & goto curlGenerateOTP
findstr /L /O /N /C:"\""" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Captcha Error" Load_Get_Appointment_captcha & call :ColorText 0A "Captcha Error" & goto Load_Get_Appointment_captcha
findstr /L /O /N /C:"No appointment dates are available" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "No appointment dates are available" EXIT & goto EXIT
findstr /L /O /N /C:"Mobile number is not valid" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Mobile number is not valid" EXIT & goto EXIT
findstr /L /O /N /C:"Session Expired" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Session Expired" Load_Get_Appointment & goto Load_Get_Appointment
findstr /L /O /N /C:"Database under maintenance" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Database under maintenance" curlGenerateOTP & goto curlGenerateOTP
findstr /L /O /N /C:"Invalid filenumber or passport number or Appointment already taken" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Invalid filenumber or passport number or Appointment already taken" pdfdownload & goto pdfdownload
findstr /L /O /N /C:"Previous otp is valid.New otp can be generated after its expiry time" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Previous otp is valid.New otp can be generated after its expiry time" GenerateOTPEND & goto GenerateOTPEND
findstr /L /O /N /C:"SMS" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "SMS Generated Sucessfully" & call :ColorText 02 "SMS SMS SMS SMS SMS"
if /i %ERRORLEVEL% EQU 1 call :logprint GenerateOTP200 "SMS Not Found" & call :ColorText 02 "SMS Not Found" & goto curlGenerateOTP
findstr /L /O /N /C:"Content-Type: application/json" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Content-Type: application/json" GenerateOTPEND & goto GenerateOTPEND
findstr /L /O /N /C:"Connection: Close" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :captchaenable & goto curlGenerateOTP
:GenerateOTP302
echo ****************** STEP GenerateOTP302 ****************** >> %fileno%-report.txt
echo ****************** STEP GenerateOTP302 ****************** >> %fileno%-log.txt
findstr /L /O /N /C:"Invalid Answer" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP302 "Invalid Answer" Load_Get_Appointment & goto Load_Get_Appointment
findstr /L /O /N /C:"Please Enter valid Passport" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP302 "Please Enter valid Passport" EXIT & goto EXIT
findstr /L /O /N /C:"No more otp can be generated today for this application ID" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP302 "No more otp can be generated today for this application ID" EXIT & goto EXIT
findstr /L /O /N /C:"\""" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Captcha Error" Load_Get_Appointment_captcha & call :ColorText 0A "Captcha Error" & goto Load_Get_Appointment_captcha
findstr /L /O /N /C:"OTP can be generated only after appointment time starts" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP302 "OTP can be generated only after appointment time starts" Load_Get_Appointment & timeout 1 & goto Load_Get_Appointment
findstr /L /O /N /C:"Invalid filenumber or OTP or Appointment Already taken" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP302 "Invalid filenumber or OTP or Appointment Already taken" Load_Get_Appointment & call :ColorText 09 "Invalid filenumber or OTP or Appointment Already taken" & timeout 5 & goto Load_Get_Appointment
findstr /L /O /N /C:"SMS" %fileno%-GenerateOTP.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "SMS Generated Sucessfully" & call :ColorText 02 "SMS SMS SMS SMS SMS"
if /i %ERRORLEVEL% EQU 1 call :logprint GenerateOTP200 "SMS Not Found" & call :ColorText 02 "SMS Not Found" & goto curlGenerateOTP
findstr /L /O /N /C:"Content-Type: application/json" %fileno%-GenerateOTPheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint GenerateOTP200 "Content-Type: application/json" GenerateOTPEND & goto GenerateOTPEND
call :logprint curlGenerateOTP "SERVER BUSY on STEP curlGenerateOTP === Retry Again" curlGenerateOTP
if /i %try% EQU 200 set try=0 & goto Load_Get_Appointment
goto curlGenerateOTP
echo ****************** Technical Problem at Line Number 305 ****************** >> %fileno%-error.txt
:GenerateOTPEND
echo ****************** STEP GenerateOTPEND ****************** >> %fileno%-report.txt
echo ****************** STEP GenerateOTPEND ****************** >> %fileno%-log.txt
c:\curl\curl%cn% -v -s --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" -d "fileno=%fileno%&passport_no=%passport_no%&birthdate=%birthdate%&otp=%otp%" http://muslimbi.com/ivac/otp/postinsert.php -w "Save OTP to server fileno=%fileno%&otp=%otp% Status \n"
call :ColorText A4 "OTP Sucessfully send to %mobilenumber%"
:checkotpdata
c:\curl\curl%cn% --fail --silent --show-error --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" http://muslimbi.com/ivac/otp/show.php?fileno=%fileno% -o %fileno%-otp.txt -w "Check OTP Save Status \n"
FOR /F %%o IN (%fileno%-otp.txt) DO SET otp=%%o
IF EXIST "%fileno%-otp.txt" del %fileno%-otp.txt
set otptime=%time%
echo ********** Time= %otptime% ********** OTP= "%otp%" **********
IF /i %otp% EQU nootp call :ColorText 09 "Waiting for OTP record" & timeout 5 & goto checkotpdata
call :logprint Check_Have_OTP "OTP GENERATED Time %otptime% OTP "%otp% by Another Script at %difftime% sec ago" Begin_have_otp
rem call :ColorText EC "Enter OTP Variable" & set /p otp=
rem c:\curl\curl%cn% -v -s --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" -d "fileno=%fileno%&passport_no=%passport_no%&birthdate=%birthdate%&otp=%otp%" http://muslimbi.com/ivac/otp/postdata.php -w "Save OTP to server fileno=%fileno%&otp=%otp% Status \n"
rem c:\curl\curl%cn% --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" http://muslimbi.com/ivac/otp/difftime.php?fileno=%fileno% -o %fileno%-difftime.txt -w "Check difftime Save Status \n"
rem IF EXIST "%fileno%-difftime.txt" FOR /F %%d IN (%fileno%-difftime.txt) DO SET difftime=%%d
rem echo ********** Time= %otptime% ###################### OTP= %otp% ********** >> %fileno%-report.txt
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-report.txt
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-report.txt
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo.>> %fileno%-report.txt
call :logprint GenerateOTPEND "STEP GenerateOTP END" Begin_have_otp
goto Begin_have_otp
echo ****************** Technical Problem at Line Number 361 ****************** >> %fileno%-error.txt
rem END curlGenerateOTP
=====================================================================================
=====================================================================================
=====================================================================================
=====================================================================================
:curl_send_alotment_sms
IF /i %difftime% GTR 10800 call :ColorText E0 "OTP different very high" & goto curlGenerateOTP
TITLE IVAC %~n0 ## STEP4 _ curl_send_alotment_sms _ CN : %cn% _ RN: %rn% _ TRY : %try%
echo ###################### STEP TWO.TWO curl version %cn% _ time %time% _ RN: %rn% _ TRY : %try% ################## >> %fileno%-report.txt
color 0E
call :ColorText E0 "Code EC Black Braground Light Yellow Text"
SET /a try+=1
if /i %try% GTR 3 SET /a _rand=%RANDOM%*100/32768+151 & set /a try=0 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
TITLE IVAC %~n0 ## STEP2 _ OTP= %otp% _ Time= %time% _ TRY : %try% _ IP : %_rand% _ CN : %cn%
echo ###################### STEP TWO.TWO curl version %cn% IP %_rand% _ time %time% _ SN: %sn% _ TRY : %try% ################## >> %fileno%-report.txt
c:\curl\curl%cn% -v --trace-time --retry 5 --retry-delay 1 -S -d -e --connect-timeout 3 -m 12 -b %fileno%_cookie.txt -c %fileno%_cookie.txt -d "otp_required=send_alotment_sms&filerfno=%fileno%&passport_no=%passport_no%&%firstvar%=%firstvalue%&%secondvar%=%secondvalue%&otp=%otp%&captcha=%appointmentcaptcha%&submit_btn=Send+Allotment+SMS&token=%tokenvar%" -H "Keep-Alive: 60" -H "Connection: keep-alive" --dump-header %fileno%-send_alotment_smsheader.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/Get_Appointment http://indianvisa-bangladesh.nic.in/visa/Get_Appointment -L -o %fileno%-send_alotment_sms.txt -w "STEP TWO.TWO send_alotment_sms Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
echo ********************** STEP TWO.TWO ****** Done by IP %_rand% _ time %time% _ SN: %sn% _ TRY : %try% ************************* >> %fileno%-report.txt
echo *********************************************************************************************** >> %fileno%-report.txt
findstr /L /O /N /C:"Invalid filenumber or passport number or Appointment not taken" %fileno%-send_alotment_sms.txt
if /i %ERRORLEVEL% EQU 0 echo ====== Error Level is %ERRORLEVEL% for ===200Invalid filenumber or passport number or Appointment not taken=== & goto curlGenerateOTP
rem Invalid Captcha
rem SMS could not be sent.Please try again
call :logprint curl_send_alotment_sms "STEP curl_send_alotment_sms END on %difftime%" curlGenerateOTP
goto curlGenerateOTP
=====================================================================================
=====================================================================================
=====================================================================================
=====================================================================================
:checktime
set currentTime=%time%
echo currentTime: %currentTime%
echo ivacTime: %ivacTime%
set /a sth=%currentTime:~0,2%
set /a stm=1%currentTime:~3,2% - 100
set /a sts=1%currentTime:~6,2% - 100
set /a eth=%ivacTime:~0,2%
set /a etm=1%ivacTime:~3,2% - 100
set /a ets=1%ivacTime:~6,2% - 100
set /a lth=0
set /a ltm=0
set /a lts=0
:CHECK_SEC
if /i %ets% LSS %sts% goto ROLL_MIN
set /a lts=%ets% - %sts%
goto CHECK_MIN
:ROLL_MIN
set /a stm+=1
set /a lts=%ets% + 60 - %sts%
:CHECK_MIN
if /i %etm% LSS %stm% goto ROLL_HOUR
set /a ltm=%etm% - %stm%
goto CHECK_HOUR
:ROLL_HOUR
set /a sth+=1
set /a ltm=%etm% + 60 - %stm%
:CHECK_HOUR
if /i %eth% LSS %sth% goto ROLL_DAY
set /a lth=%eth% - %sth%
goto DONE
:ROLL_DAY
set /a lth=%eth% + 24 - %sth%
:DONE
if /i %lts% GTR 59 (
set lts%%=60
set ltm+=1
)
if /i %ltm% GTR 59 (
set ltm%%=60
set lth+=1
)
echo Lapsed hours: %lth%
echo Lapsed minutes: %ltm%
echo Lapsed seconds: %lts%
set /a tls = %lth% * 60 * 60 + %ltm% * 60 + %lts%
echo Total Lapsed Seconds: %tls%
exit /b
=====================================================================================
=====================================================================================
=====================================================================================
=====================================================================================
:entryvalue
echo ################################################################
echo ############### DisplayDynamicField1 Variable Missing!!!!!!
echo ############### Press f for Father's Name "%fathername%"
echo ############### Press m for Mother's Name "%mothername%"
echo ############### Press g for Fiven Name "%givenname%"
echo ############### Press b for Place of Birth "%birthplace%"
echo ############### Please Enter Variable
set /p ev=
if %~1 EQU DDF1 (
if /i %ev% EQU f SET firstvalue=%fathername%& SET filecontent1="Father's Name"
if /i %ev% EQU m SET firstvalue=%mothername%& SET filecontent1="Mother's Name"
if /i %ev% EQU g SET firstvalue=%givenname%& SET filecontent1="Fiven Name"
if /i %ev% EQU b SET firstvalue=%birthplace%& SET filecontent1="Place of Birth"
)
if %~1 EQU DDF2 (
if /i %ev% EQU f SET secondvalue=%fathername%& SET filecontent2="Father's Name"
if /i %ev% EQU m SET secondvalue=%mothername%& SET filecontent2="Mother's Name"
if /i %ev% EQU g SET secondvalue=%givenname%& SET filecontent2="Fiven Name"
if /i %ev% EQU b SET secondvalue=%birthplace%& SET filecontent2="Place of Birth"
)
exit /b
=====================================================================================
=====================================================================================
=====================================================================================
=====================================================================================
:logprint
echo ********************** Error Level is %ERRORLEVEL% for %~1 ### "%~2" ### %~3
echo ################################################################################
echo [%time%] Error Level is %ERRORLEVEL% for %~1 ### "%~2" ### %~3 >> %fileno%-log.txt
echo ********************** ********************** ********************** >> %fileno%-log.txt
echo [%time%] Error Level is %ERRORLEVEL% for %~1 ### "%~2" ### %~3 >> %fileno%-report.txt
echo ********************** ********************** ********************** >> %fileno%-report.txt
exit /b
=====================================================================================
=====================================================================================
=====================================================================================
=====================================================================================
:ColorText
echo off
<nul set /p .=. > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
echo(%DEL%%DEL%%DEL%
del "%~2" > nul 2>&1
goto :eof
exit /b
=====================================================================================
=====================================================================================
=====================================================================================
=====================================================================================
:getFilesize
set filesize=%~z1
exit /b
:captchaenable
echo ****************** STEP captchaenable ****************** >> %fileno%-report.txt
exit /b
=====================================================================================
=====================================================================================
=====================================================================================
=====================================================================================
:Begin_have_otp
TITLE IVAC %~n0 ## STEP4 _ Begin_have_otp _ CN : %cn% _ RN: %rn% _ TRY : %try%
echo ###################### STEP BEGIN_HAVE_OTP *BEGIN* *START* ###################### >> %fileno%-report.txt
call :ColorText 97 "###################### STEP TWO THREE BEGIN START ######################"
echo ###################### STEP BEGIN_HAVE_OTP *BEGIN* *START* ###################### >> %fileno%-report.txt
set /a try=0
set /a sn=0
SET /a rn=%RANDOM%*20/32768
:Processhaveotp
TITLE IVAC %~n0 ## STEP4 _ Begin_have_otp difftime _ IP : %_rand% _ CN : %cn% _ SN: %sn% _ TRY : %try%
echo ###################### %sn% Current IP Address %_rand% code is %ImgNum2% ajaxCap %ajaxCap% captchatime %captchatime% ######################
echo ****************** STEP Processhaveotp ****************** >> %fileno%-report.txt
c:\curl\curl%cn% --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" http://muslimbi.com/ivac/otp/difftime.php?fileno=%fileno% -o %fileno%-difftime.txt
IF EXIST "%fileno%-difftime.txt" FOR /F %%d IN (%fileno%-difftime.txt) DO SET difftime=%%d
IF /i %difftime% GTR 800 goto Load_Get_Appointment
:curl_have_otp
color EC
call :ColorText CE "Code EC Light Yellow Braground Light Red Text"
SET /a try+=1
if /i %try% GTR 3 SET /a _rand=%RANDOM%*100/32768+151 & set /a try=0 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
TITLE IVAC %~n0 ## STEP4 _ Begin_have_otp _ OTP= %otp% _ Time= %time% _ TRY : %try% _ IP : %_rand% _ CN : %cn%
echo ###################### STEP TWO.THREE curl version %cn% IP %_rand% _ time %time% _ SN: %sn% _ TRY : %try% ################## >> %fileno%-report.txt
c:\curl\curl%cn% -v --trace-time --retry 5 --retry-delay 1 -S -d -e --connect-timeout 3 -m 10 -b %fileno%_cookie.txt -c %fileno%_cookie.txt -d "otp_required=HAVE_OTP&filerfno=%fileno%&passport_no=%passport_no%&%firstvar%=%firstvalue%&%secondvar%=%secondvalue%&otp=%otp%&captcha=%appointmentcaptcha%&submit_btn=Submit&token=%tokenvar%" -H "Keep-Alive: 60" -H "Connection: keep-alive" --dump-header %fileno%-allotmenthaveheader.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/Get_Appointment http://indianvisa-bangladesh.nic.in/visa/Get_Appointment -L -o %fileno%-allotmenthaveotp.txt -w "STEP TWO.THREE PROCESSHAVEOTP Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
echo ********************** STEP TWO.THREE ****** Done by IP %_rand% _ time %time% _ SN: %sn% _ TRY : %try% ************************* >> %fileno%-report.txt
echo *********************************************************************************************** >> %fileno%-report.txt
findstr /L /O /N /C:"HTTP/1.1 302 Found" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curl_have_otp "HTTP/1.1 302 Found" Processhaveotp302 & goto Processhaveotp302
findstr /L /O /N /C:"HTTP/1.1 302" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curl_have_otp "HTTP/1.1 302" Processhaveotp302 & goto Processhaveotp302
findstr /L /O /N /C:"HTTP/1.1 200 OK" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curl_have_otp "HTTP/1.1 200 OK" Processhaveotp200 & goto Processhaveotp200
findstr /L /O /N /C:"HTTP/1.1 200" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint curl_have_otp "HTTP/1.1 200" Processhaveotp200 & goto Processhaveotp200
call :logprint curl_have_otp "SERVER BUSY === Retry Again STEP CURL_HAVE_OTP" curl_have_otp
if /i %try% EQU 20 set try=0 & goto Processhaveotp
goto curl_have_otp
echo ************************* Technical Problem ***************************** >> %fileno%-error.txt
:Processhaveotp302
echo ********************** STEP Processhaveotp302 ************************* >> %fileno%-report.txt
echo ********************** STEP Processhaveotp302 ************************* >> %fileno%-log.txt
findstr /L /O /N /C:"Invalid Answer" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp302 "Invalid Answer" Processhaveotp & goto Processhaveotp
findstr /L /O /N /C:"Invalid OTP" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp302 "Invalid OTP" Processhaveotp & goto Processhaveotp
findstr /L /O /N /C:"Please generate OTP" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp302 "Please generate OTP" Load_Get_Appointment & goto Load_Get_Appointment
findstr /L /O /N /C:"Your OTP is expired" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp302 "Your OTP is expired" curl_send_alotment_sms & goto curl_send_alotment_sms
findstr /r "invalid.html" %fileno%-allotmenthaveheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp302 "invalid.html"
findstr /L /O /N /C:"Invalid Request" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp302 "Invalid Request" curlGenerateOTP & goto curlGenerateOTP
:Processhaveotp200
echo ********************** STEP Processhaveotp200 ************************* >> %fileno%-report.txt
echo ********************** STEP Processhaveotp200 ************************* >> %fileno%-log.txt
findstr /L /O /N /C:"Invalid Answer" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "Invalid Answer" Processhaveotp & goto Processhaveotp
findstr /L /O /N /C:"Your OTP is expired" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "Your OTP is expired" curl_send_alotment_sms & goto curl_send_alotment_sms
findstr /L /O /N /C:"some error occured" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "some error occured" Begin_Get_Appointment & goto Begin_Get_Appointment
findstr /L /O /N /C:"Please generate OTP" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "Please generate OTP" Load_Get_Appointment & goto Load_Get_Appointment
findstr /L /O /N /C:"Invalid OTP. Please try again" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "Invalid OTP. Please try again" Load_Get_Appointment & goto Load_Get_Appointment
findstr /L /O /N /C:"Invalid filenumber or passport number or Appointment Already taken" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "Invalid filenumber or passport number or Appointment Already taken" Load_Get_Appointment & goto Load_Get_Appointment
findstr /L /O /N /C:"The Problem may be due to 500 Server Error/404 Page Not Found" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "The Problem may be due to 500 Server Error/404 Page Not Found" curl_have_otp & goto curl_have_otp
findstr /L /O /N /C:"No appointment dates are available.Please contact respective mission" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "No appointment dates are available.Please contact respective mission" EXIT & goto EXIT
findstr /L /O /N /C:"Appointment for Visa Application" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "Appointment for Visa Application" RetriveAllotment
findstr /L /O /N /C:"Appointment already taken on" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 " Appointment already taken on" EXIT & goto EXIT
findstr /L /O /N /C:"allotment_date" %fileno%-allotmenthaveotp.txt
if /i %ERRORLEVEL% EQU 0 call :logprint Processhaveotp200 "allotment_date" RetriveAllotment & goto RetriveAllotment
if /i %ERRORLEVEL% EQU 1 call :logprint Processhaveotp200 "allotment_date" curl_have_otp & goto curl_have_otp
=====================================================================================
=====================================================================================
=====================================================================================
=====================================================================================
:RetriveAllotment
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-report.txt
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-report.txt
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo.>> %fileno%-report.txt
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-log.txt
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-log.txt
echo ###################### STEP TWO *END* *END* *END* *END* ###################### >> %fileno%-log.txt
echo.>> %fileno%-log.txt
echo.>> %fileno%-log.txt
echo.>> %fileno%-log.txt
echo.>> %fileno%-log.txt
echo.>> %fileno%-log.txt
echo ********************** Error Level is %ERRORLEVEL% in Appointment for Visa Application >> %fileno%-report.txt
echo ********************** Error Level is %ERRORLEVEL% in Appointment for Visa Application >> %fileno%-log.txt
set /a try=0
findstr /c:"token" %fileno%-allotmenthaveotp.txt > %fileno%-Allotmenttoken.txt
FOR /F "usebackq tokens=4" %%n IN (%fileno%-Allotmenttoken.txt) DO SET allotmenttokenvar=%%n
set allotmenttokenvar=%allotmenttokenvar:~7,36%
echo Allotment Token = "%allotmenttokenvar%"
echo %allotmenttokenvar%| findstr /r "^[a-z0-9!-]*$"
if errorlevel 1 start %fileno%-Allotmenttoken.txt & echo "Allotment Token Variable Missing!!!!!! Enter Allotment Token Variable" & set /p allotmenttokenvar=
echo ################################################ >> %fileno%-report.txt
echo Appointment Token Value = "%tokenvar%" & echo Appointment Token Value = "%tokenvar%" >> %fileno%-report.txt
echo Allotment Token Value = "%allotmenttokenvar%" & echo Allotment Token Value = "%allotmenttokenvar%" >> %fileno%-report.txt
echo ################################################ >> %fileno%-report.txt
set today=%date:~7,2%/%date:~4,2%/%date:~10,4%
if /i %pia% EQU BGDD set /a apd=1%date:~7,2% - 100 + 7
if /i %pia% EQU BGDC set /a apd=1%date:~7,2% - 100 + 7
if /i %pia% EQU BGDR set /a apd=1%date:~7,2% - 100 + 10
set aptdate=%apd%/%date:~4,2%/%date:~10,4%
if /i %apd% GTR 30 call :ColorText EC "Enter Confirmation DATE here" & set /p aptdate=
rem set aptdate=05/04/2017
goto final
=============================================================================================
:final
color A9
TITLE IVAC %~n0 ## FINAL _ OTP= %otp% _ Time= %otptime% _ TRY : %try% _ IP : %_rand% _ CN : %cn%
SET /a try+=1
if /i %try% GTR 3 SET /a _rand=%RANDOM%*100/32768+151 & set /a try=0 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
SET /a cn=%RANDOM%*8/32768
echo curl version %cn%
:Load_Allotment_captcha
TITLE IVAC %~n0 ## STEP1 _ Load_Allotment_captcha _ CN : %cn% _ RN: %rn% _ TRY : %try%
color A9
TITLE IVAC %~n0 ## FINAL CAPTCHA _ OTP= %otp% _ Time= %otptime% _ TRY : %try% _ IP : %_rand% _ CN : %cn%
SET /a try+=1
if /i %try% GTR 3 SET /a _rand=%RANDOM%*100/32768+151 & set /a try=0 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
SET /a cn=%RANDOM%*8/32768
echo curl version %cn%
c:\curl\curl%cn% -v --trace-time -S -d -e --connect-timeout 3 -m 10 -b %fileno%_cookie.txt -c %fileno%_cookie.txt --dump-header %fileno%-allotmentcaptchaheader.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/Allotment http://indianvisa-bangladesh.nic.in/visa/captcha -o %fileno%-allotmentcaptcha.jpg -w "STEP FINAL CAPTCHA Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
if not exist "%fileno%-allotmentcaptcha.jpg" goto Load_Allotment_captcha
echo ********************** STEP FINAL CAPTCHA ****** Done by IP %_rand% _ time %time% _ SN: %sn% _ TRY : %try% ************************* >> %fileno%-report.txt
findstr /L /O /N /C:"Content-Type: text/html" %fileno%-allotmentcaptchaheader.txt
if /i %ERRORLEVEL% EQU 0 call :captchaenable & goto Load_Allotment_captcha
findstr /L /O /N /C:"Content-Type: image/jpeg" %fileno%-allotmentcaptchaheader.txt
if /i %ERRORLEVEL% EQU 0 echo ********************** Error Level is %ERRORLEVEL% for ===STEP FINAL CAPTCHA=== & goto retrivecode
call :logprint Load_Allotment_captcha "SERVER BUSY Retry Again STEP FINAL CAPTCHA" Load_Allotment_captcha
goto Load_Allotment_captcha
:retrivecode
color A4
echo ####### Start FC on time %time% ####### %ImgNum1% ####### %ImgNum2% ####### %ImgNum3% ####### %ImgNum% ####### >> %fileno%-report.txt
c:\curl\curl -S -F "source_url=" -F "captcha_platform=" -F "action=Submit" -F "file=@%fileno%-allotmentcaptcha.jpg" http://122.144.12.253:8181/gsa_test.gsa -o %fileno%-code.txt
FOR /F "tokens=11 delims=<\/>" %%m IN (%fileno%-code.txt) DO del %fileno%-allotmentcaptcha.jpg & SET ImgNum=%%m
echo ####### End FC on time %time% ####### %ImgNum1% ####### %ImgNum2% ####### %ImgNum3% ####### %ImgNum% ####### >> %fileno%-report.txt
set try=0
echo -----------------------------------------------------------------
echo ++++ today ========== %today% ++++ apptdate ======= %aptdate%
echo Please Enter final captcha Value & set /p ImgNum=
echo ################################################ >> %fileno%-report.txt
echo "fileno=%fileno%" >> %fileno%-report.txt
echo "APPLNAME=%APPLNAME%" >> %fileno%-report.txt
echo "PIA=%pia%" >> %fileno%-report.txt
echo "DATE=%aptdate%" >> %fileno%-report.txt
echo "reotp=%otp%" >> %fileno%-report.txt
echo Appointment captcha Value = "%appointmentcaptcha%" & echo Appointment captcha Value = "%appointmentcaptcha%" >> %fileno%-report.txt
echo Allotment captcha Value = "%ImgNum%" & echo Allotment captcha Value = "%ImgNum%" >> %fileno%-report.txt
echo Appointment Token Value = "%tokenvar%" & echo Appointment Token Value = "%tokenvar%" >> %fileno%-report.txt
echo Allotment Token Value = "%allotmenttokenvar%" & echo Allotment Token Value = "%allotmenttokenvar%" >> %fileno%-report.txt
echo ################################################ >> %fileno%-report.txt
:postdata
color 09
TITLE IVAC %~n0 ## POSTDATA _ OTP= %otp% _ Time= %otptime% _ APPLNAME : %APPLNAME%
call :ColorText 0C "curl version %cn%"
echo =================== IP: %_rand% =================== Retry: %try% =================== >> %fileno%-report.txt
SET /a try+=1
if /i %try% GTR 3 SET /a _rand=%RANDOM%*100/32768+151 & set /a try=0 & SET socks5=--socks5 103.239.6.%_rand%:1080 --proxy-user danteproxy:dantepass
c:\curl\curl%cn% -v --trace-time -S -m 10 -b %fileno%_cookie.txt -c %fileno%_cookie.txt -d "DATE=%aptdate%&reotp=%otp%&captcha=%ImgNum%&submit_btn=Confirm+The+Appointment&token=%allotmenttokenvar%" --dump-header %fileno%-allotmentheader.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/Allotment http://indianvisa-bangladesh.nic.in/visa/Allotment -o %fileno%-allotmentsave.txt -w "STEP Final Data Post to Server Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
if /i %try% EQU 20 SET /a _rand=%RANDOM%*100/32768+151 & set try=0
findstr /L /O /N /C:"HTTP/1.1 200 OK" %fileno%-allotmentheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint postdata "HTTP/1.1 200 OK" checkfinal200 & goto checkfinal200
findstr /L /O /N /C:"HTTP/1.1 200" %fileno%-allotmentheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint postdata "HTTP/1.1 200" checkfinal200 & goto checkfinal200
findstr /L /O /N /C:"HTTP/1.1 302 Found" %fileno%-allotmentheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint postdata "HTTP/1.1 302 Found" checkfinal302 & goto checkfinal302
findstr /L /O /N /C:"HTTP/1.1 302" %fileno%-allotmentheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint postdata "HTTP/1.1 302 Found" checkfinal302 & goto checkfinal302
call :logprint postdata "SERVER BUSY Retry Again STEP POSTDATA" postdata
goto postdata
:checkfinal302
findstr /L /O /N /C:"Invalid Captcha" %fileno%-allotmentheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint checkfinal302 "Invalid Captcha" Load_Allotment_captcha & goto Load_Allotment_captcha
findstr /r "invalid.html" %fileno%-allotmentheader.txt
if /i %ERRORLEVEL% EQU 0 call :logprint checkfinal302 "invalid.html" EXIT & goto EXIT
:checkfinal200
findstr /L /O /N /C:"The Problem may be due to 500 Server Error/404 Page Not Found" %fileno%-allotmentsave.txt
if /i %ERRORLEVEL% EQU 0 call :logprint checkfinal200 "The Problem may be due to 500 Server Error/404 Page Not Found" postdata & goto postdata
findstr /L /O /N /C:"Invalid input" %fileno%-allotmentsave.txt
if /i %ERRORLEVEL% EQU 0 call :logprint checkfinal200 "Invalid input" postdata & call :ColorText 0C "Invalid input" & goto postdata
findstr /L /O /N /C:"Appointment already taken on . Please try for next appointment after" %fileno%-allotmentsave.txt
if /i %ERRORLEVEL% EQU 0 call :logprint checkfinal200 "Appointment already taken on . Please try for next appointment after" EXIT & goto EXIT
findstr /L /O /N /C:"No appointment dates are available.Please contact respective mission" %fileno%-allotmentsave.txt
if /i %ERRORLEVEL% EQU 0 call :logprint checkfinal200 "No appointment dates are available.Please contact respective mission" postdata & goto postdata
findstr /r "%fileno%" %fileno%-allotmentsave.txt
if /i %ERRORLEVEL% EQU 0 goto savedonerecord
if /i %ERRORLEVEL% EQU 1 goto postdata
call :logprint postdata "SERVER BUSY in checkfinal200 Retry Again STEP POSTDATA" postdata
goto postdata
:savedonerecord
c:\curl\curl%cn% -v -s --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" -d "fileno=%fileno%&passport_no=%passport_no%&birthdate=%birthdate%&APPLNAME=%APPLNAME%" http://muslimbi.com/ivac/allotmentsave/postdata.php
findstr /c:"token" %fileno%-allotmentsave.txt > %fileno%-pdftoken.txt
FOR /F "usebackq tokens=4" %%n IN (%fileno%-pdftoken.txt) DO SET pdftoken=%%n
set pdftoken=%pdftoken:~7,36%
call :logprint checkfinal200 "Your appointment for Application Id %fileno% is successful" & call :ColorText 0C "Your appointment for Application Id %fileno% is successful"
:pdfdownload
call :ColorText EC "DO YOU WANT TO DOWNLOAD THE PDF #YES#NO# or #Y#N#" & set /p pdfdown=
IF /i %pdfdown% EQU N goto EXIT
IF /i %pdfdown% EQU Y goto pdfprocess
:pdfprocess
c:\curl\curl%cn% -v --trace-time -S -d -e --connect-timeout 4 -m 15 -b otpcookie%rn%.txt -c %fileno%_cookie.txt -H "Keep-Alive: 60" -H "Connection: keep-alive" --dump-header %fileno%-Print_header.txt --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" --referer http://indianvisa-bangladesh.nic.in/visa/index.html http://indianvisa-bangladesh.nic.in/visa/PrintApplication -L -o %fileno%-PrintApplication.txt -w "STEP ONE.ONE Appointment_Login OTP Processing on %time% by %try% \n" 1>> %fileno%-log.txt 2>> %fileno%-report.txt
findstr /c:"token" %fileno%-PrintApplication.txt > %fileno%-PrintApplication_token.txt
FOR /F "usebackq tokens=4" %%n IN (%fileno%-PrintApplication_token.txt) DO SET pdftoken=%%n
set pdftoken=%pdftoken:~7,36%
echo PDF Token = "%pdftoken%"
echo %pdftoken%| findstr /r "^[a-z0-9!-]*$"
if errorlevel 1 start %fileno%-PrintApplication_token.txt & echo "Token Variable Missing!!!!!! Enter Second Variable" & set /p pdftoken=
:downloadingpdf