@@ -188,9 +188,25 @@ def idcoupons():
188
188
idc_bar .close ()
189
189
190
190
191
+ def enext () -> list :
192
+ en_links = []
193
+ r = requests .get ("https://e-next.in/e/udemycoupons.php" )
194
+ soup = bs (r .content , "html.parser" )
195
+ big_all = soup .find_all ("p" , {"class" : "p2" })
196
+ big_all .pop (0 )
197
+ en_bar = tqdm (total = len (big_all ), desc = "E-next" )
198
+ for i in big_all :
199
+ en_bar .update (1 )
200
+ title = i .text .strip ().removesuffix ("Enroll Now free" ).strip ()
201
+ link = i .a ["href" ]
202
+ en_links .append (title + "|:|" + link )
203
+
204
+ en_bar .close ()
205
+
206
+
191
207
# Constants
192
208
193
- version = "v1.3 "
209
+ version = "v1.4 "
194
210
195
211
196
212
def create_scrape_obj ():
@@ -201,6 +217,7 @@ def create_scrape_obj():
201
217
"Real Discount" : threading .Thread (target = real_discount , daemon = True ),
202
218
"Course Vania" : threading .Thread (target = coursevania , daemon = True ),
203
219
"IDownloadCoupons" : threading .Thread (target = idcoupons , daemon = True ),
220
+ "E-next" : threading .Thread (target = enext , daemon = True ),
204
221
}
205
222
return funcs
206
223
@@ -238,7 +255,9 @@ def load_settings():
238
255
settings ["languages" ]["Russian" ]
239
256
except KeyError :
240
257
settings ["languages" ]["Russian" ] = True
241
- settings .setdefault ("save_txt" , True ) #v1.3
258
+ settings .setdefault ("save_txt" , True ) # v1.3
259
+ settings ["sites" ].setdefault ("E-next" , True ) # v1.4
260
+ settings .setdefault ("discounted_only" , False ) # v1.4
242
261
return settings , instructor_exclude , title_exclude
243
262
244
263
@@ -334,12 +353,12 @@ def check_login(email, password):
334
353
data = {
335
354
"email" : email ,
336
355
"password" : password ,
356
+ "locale" : "en_US" ,
337
357
"csrfmiddlewaretoken" : csrf_token ,
338
358
}
339
359
s .headers .update (
340
360
{
341
361
"Referer" : "https://www.udemy.com/join/login-popup/?locale=en_US" ,
342
- "user-agent" : "APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)" ,
343
362
}
344
363
)
345
364
r = s .post (
@@ -437,7 +456,7 @@ def auto(list_st):
437
456
if settings ["save_txt" ]:
438
457
if not os .path .exists ("Courses/" ):
439
458
os .makedirs ("Courses/" )
440
- txt_file = open (f"Courses/" + time .strftime ("%Y-%m-%d--%H-%M" ),"w" )
459
+ txt_file = open (f"Courses/" + time .strftime ("%Y-%m-%d--%H-%M" ), "w" )
441
460
for index , combo in enumerate (list_st ):
442
461
443
462
tl = combo .split ("|:|" )
@@ -483,8 +502,11 @@ def auto(list_st):
483
502
print (fg + "Successfully Enrolled\n " )
484
503
se_c += 1
485
504
as_c += amount
486
- if settings ["save_txt" ]: txt_file .write (combo + "\n " )
487
-
505
+ if settings ["save_txt" ]:
506
+ txt_file .write (combo + "\n " )
507
+ txt_file .flush ()
508
+ os .fsync (txt_file .fileno ())
509
+
488
510
elif js ["status" ] == "failed" :
489
511
# print(js)
490
512
print (fr + "Coupon Expired\n " )
@@ -520,7 +542,10 @@ def auto(list_st):
520
542
print (fg + "Successfully Subscribed\n " )
521
543
se_c += 1
522
544
as_c += amount
523
- if settings ["save_txt" ]: txt_file .write (combo + "\n " )
545
+ if settings ["save_txt" ]:
546
+ txt_file .write (combo + "\n " )
547
+ txt_file .flush ()
548
+ os .fsync (txt_file .fileno ())
524
549
except :
525
550
print (fr + "COUPON MIGHT HAVE EXPIRED\n " )
526
551
e_c += 1
@@ -560,30 +585,19 @@ def main1():
560
585
funcs [t ].join ()
561
586
time .sleep (1 )
562
587
563
- try : # du_links
564
- links_ls += du_links
565
- except :
566
- pass
567
- try : # uf_links
568
- links_ls += uf_links
569
- except :
570
- pass
571
- try : # tb_links
572
- links_ls += tb_links
573
- except :
574
- pass
575
- try : # rd_links
576
- links_ls += rd_links
577
- except :
578
- pass
579
- try : # cv_links
580
- links_ls += cv_links
581
- except :
582
- pass
583
- try : # idc_links
584
- links_ls += idc_links
585
- except :
586
- pass
588
+ for link_list in [
589
+ "du_links" ,
590
+ "uf_links" ,
591
+ "tb_links" ,
592
+ "rd_links" ,
593
+ "cv_links" ,
594
+ "idc_links" ,
595
+ "en_links" ,
596
+ ]:
597
+ try :
598
+ links_ls += eval (link_list )
599
+ except :
600
+ pass
587
601
588
602
auto (links_ls )
589
603
0 commit comments