Esempio n. 1
0
def main():

    sys.stdout.write(banner())

    product_id1 = input('Enter product id or Sale url: ')
    if '/in/goods/' in product_id1 or product_id1.isdigit():
        product_id = re.findall(r'\d+', product_id1)[0]
    else:
        print(
            '\nIncorrect Sale url\nSale Url should be like https://buy.realme.com/in/goods/188'
        )
        exit()
    all_cookies = input(
        'Enter cookie file(s) on which you want to order seprated with comma "," ex- cookie1.txt,cookie2.txt '
    )

    cookie_list = []

    regex = re.compile(',')
    if (regex.search(all_cookies) != None):
        c_ar = all_cookies.split(',')
        for c in c_ar:
            c = c.strip()
            cookie_file = Path('./my_cookies/' + c)
            if cookie_file.exists():
                cookie_list.append(c)
                added = 1
            else:
                added = 0
                print(
                    '\nSeems like your cookie file (' + c +
                    ') doesn\'t exists in my_cookies folder\nPlease add all your cookie files to my_cookies folder'
                )
                exit()
    else:
        cook = all_cookies.strip()
        cookie_file = Path('./my_cookies/' + cook)
        if cookie_file.exists():
            cookie_list.append(cook)
            added = 1
        else:
            added = 0
            print(
                '\nSeems like your cookie file (' + cook +
                ') doesn\'t exists in my_cookies folder\nPlease add all your cookie files to my_cookies folder'
            )
            exit()
    if added == 1:
        print('Cookie files added')
        input('Once sale begins press enter key to start: ')
        for i in cookie_list:
            os.system('start cmd /k python realme.py -c ' + i + ' -id ' +
                      str(product_id))
def main():
    sys.stdout.write(banner())
    version = '1.0'
    parser = argparse.ArgumentParser(description='',
                                     conflict_handler="resolve")
    general = parser.add_argument_group("General")
    general.add_argument(
        '-h', '--help',\
        action='help',\
        help="Shows the help.")
    general.add_argument(
        '-v', '--version',\
        action='version',\
        version=version,\
        help="Shows the version.")
    authentication = parser.add_argument_group("Authentication")
    authentication.add_argument(
        '-c', '--cookies',\
        dest='cookies',\
        type=str,\
        help="Cookies to authenticate",metavar='')

    authentication.add_argument(
        '-k', '--cron',\
        dest='cron',\
        action='store_true',\
        help="Added support to create a cron job/task")

    try:
        args = parser.parse_args()
        ip = ".".join(map(str, (random.randint(0, 255) for _ in range(4))))
        if args.cookies:
            print('\n' + fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fg +
                  'Trying to login with cookies! \n')
            time.sleep(0.8)
            cookies_file = Path(args.cookies)
            if cookies_file.exists():
                fp = open(cookies_file, 'r')
                try:
                    fp_toks = fp.read().split('||')
                    access_token = fp_toks[0]
                    client_id = fp_toks[1]
                    print(fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fg +
                          'Login Successful! \n')
                except Exception as z:
                    print(fr + 'cookie file is not in right format')
                    exit()

                csrftoken = ''
                cookies = cookiejar(client_id, access_token)
                head = {
                    'authorization': 'Bearer ' + access_token,
                    'accept': 'application/json, text/plain, */*',
                    'x-requested-with': 'XMLHttpRequest',
                    'user-agent':
                    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
                    'x-forwarded-for': str(ip),
                    'x-udemy-authorization': 'Bearer ' + access_token,
                    'content-type': 'application/json;charset=UTF-8',
                    'referer':
                    'https://www.udemy.com/courses/search/?q=free%20courses&src=sac&kw=free',
                    'origin': 'https://www.udemy.com'
                }
            else:
                print(fr + 'Cookie file does not exists')
                exit()
        else:
            my_cookies, cookies = fetch_cookies()
            try:
                access_token = my_cookies['access_token']
                csrftoken = my_cookies['csrftoken']

                head = {
                    'authorization': 'Bearer ' + access_token,
                    'accept': 'application/json, text/plain, */*',
                    'x-requested-with': 'XMLHttpRequest',
                    'user-agent':
                    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
                    'x-forwarded-for': str(ip),
                    'x-udemy-authorization': 'Bearer ' + access_token,
                    'content-type': 'application/json;charset=UTF-8',
                    'origin': 'https://www.udemy.com',
                    'referer': 'https://www.udemy.com/'
                }
                print('\n' + fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' +
                      fg + 'Auto Login Successful! \n')

            except Exception as e:
                print(
                    '\n' + fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' +
                    fr +
                    'Make sure you are logged in to udemy.com in chrome browser'
                )
                access_token = ''
        if access_token != '':
            time.sleep(0.8)
            print(fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fw +
                  'Websites Available: ')
            bad_colors = ['BLACK', 'WHITE', 'LIGHTBLACK_EX', 'RESET']
            codes = vars(colorama.Fore)
            colors = [
                codes[color] for color in codes if color not in bad_colors
            ]
            for site in total_sites:
                print(random.choice(colors) + site)

            try:
                if args.cron:
                    input_1 = 'y'
                else:
                    print(
                        '\n' + fc + sd + '----' + fm + sb + '>>' + fb +
                        ' Want to see available coupons (INPUT "n") OR subscribe to all available courses automatically (input "y"): ',
                        end='')
                    input_1 = input()
                    more = ''
            except:
                pass

            if input_1 == 'n':
                global d
                d = 1
                for site_index, site in enumerate(total_sites):
                    if site == 'Learn Viral':
                        limit = 10
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Learn Viral ' + fm + sb + '<<' + fc + sd +
                              '-------\n')
                        while d <= limit:
                            list_st = learnviral(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Discudemy':
                        limit = 4
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Discudemy ' + fm + sb + '<<' + fc + sd +
                              '-------\n')
                        while d <= limit:
                            list_st = discudemy(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Udemy Freebies':
                        limit = 4
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Udemy Freebies ' + fm + sb + '<<' + fc +
                              sd + '-------\n')
                        while d <= limit:
                            list_st = udemy_freebies(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Udemy Coupons':
                        limit = 4
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Udemy Coupons ' + fm + sb + '<<' + fc +
                              sd + '-------\n')
                        while d <= limit:
                            list_st = udemy_coupons_me(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Real Discount':
                        limit = 4
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Real Discount ' + fm + sb + '<<' + fc +
                              sd + '-------\n')
                        while d <= limit:
                            list_st = real_disc(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Tricks Info':
                        limit = 6
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Tricks Info ' + fm + sb + '<<' + fc + sd +
                              '-------\n')
                        while d <= limit:
                            list_st = tricksinfo(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Free Web Cart':
                        limit = 7
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Free Web Cart ' + fm + sb + '<<' + fc +
                              sd + '-------\n')
                        while d <= limit:
                            list_st = freewebcart(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Course Mania':
                        limit = 1
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Course Mania ' + fm + sb + '<<' + fc +
                              sd + '-------\n')
                        while d <= limit:
                            list_st = course_mania(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Help Covid':
                        limit = 1
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Help Covid ' + fm + sb + '<<' + fc + sd +
                              '-------\n')
                        while d <= limit:
                            list_st = helpcovid(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Jojo Coupons':
                        limit = 4
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Jojo Coupons ' + fm + sb + '<<' + fc +
                              sd + '-------\n')
                        while d <= limit:
                            list_st = jojocoupons(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
                    if site == 'Online Tutorials':
                        limit = 4
                        print('\n' + fc + sd + '-------' + fm + sb + '>>' +
                              fb + ' Online Tutorials ' + fm + sb + '<<' + fc +
                              sd + '-------\n')
                        while d <= limit:
                            list_st = onlinetutorials(d)
                            site = process(list_st, d, limit, site_index,
                                           cookies, access_token, csrftoken,
                                           head)
                            d += 1
            elif input_1 == 'y':
                global count
                count = 0
                for index, items in enumerate(func_list):
                    print('\n' + fc + sd + '-------' + fm + sb + '>> ' + fb +
                          total_sites[index] + fm + sb + ' <<' + fc + sd +
                          '-------\n')
                    limit = site_range[index]
                    for d in range(1, limit):
                        list_st = items(d)
                        auto_add(list_st, cookies, access_token, csrftoken,
                                 head)
        else:
            print('Make sure you are logged in to udemy.com in chrome browser')
    except Exception as e:
        print(e)
        exit('\nunknown error')
Esempio n. 3
0
def main():
    sys.stdout.write(banner())
    cookies = browser_cookie3.chrome(domain_name='www.udemy.com')
    my_cookies = requests.utils.dict_from_cookiejar(cookies)
    try:
        access_token = my_cookies['access_token']
        csrftoken = my_cookies['csrftoken']

    except Exception as e:
        print('\n' + fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fr +
              'Make sure you are logged in to udemy.com in chrome browser')
        access_token = ''
    if access_token != '':
        print('\n' + fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fg +
              'Auto Login Successful! \n')
        time.sleep(0.8)
        print(fc + sd + '[' + fm + sb + '*' + fc + sd + '] ' + fw +
              'Websites Available: ')
        bad_colors = ['BLACK', 'WHITE', 'LIGHTBLACK_EX', 'RESET']
        codes = vars(colorama.Fore)
        colors = [codes[color] for color in codes if color not in bad_colors]
        for site in total_sites:
            print(random.choice(colors) + site)

        print(
            '\n' + fc + sd + '----' + fm + sb + '>>' + fb +
            ' Want to see available coupons (INPUT "n") OR subscribe to all available courses automatically (input "y"): ',
            end='')
        input_1 = input()
        more = ''

        if input_1 == 'n':
            global d
            d = 1
            for site_index, site in enumerate(total_sites):
                if site == 'Learn Viral':
                    limit = 10
                    print('\n' + fc + sd + '-------' + fm + sb + '>>' + fb +
                          ' Learn Viral ' + fm + sb + '<<' + fc + sd +
                          '-------\n')
                    while d <= limit:
                        list_st = learnviral(d)
                        site = process(list_st, d, limit, site_index, cookies,
                                       access_token, csrftoken)
                        d += 1
                if site == 'Discudemy':
                    limit = 4
                    print('\n' + fc + sd + '-------' + fm + sb + '>>' + fb +
                          ' Discudemy ' + fm + sb + '<<' + fc + sd +
                          '-------\n')
                    while d <= limit:
                        list_st = discudemy(d)
                        site = process(list_st, d, limit, site_index)
                        d += 1
                if site == 'Udemy Freebies':
                    limit = 4
                    print('\n' + fc + sd + '-------' + fm + sb + '>>' + fb +
                          ' Udemy Freebies ' + fm + sb + '<<' + fc + sd +
                          '-------\n')
                    while d <= limit:
                        list_st = udemy_freebies(d)
                        site = process(list_st, d, limit, site_index)
                        d += 1
                if site == 'Udemy Coupons':
                    limit = 4
                    print('\n' + fc + sd + '-------' + fm + sb + '>>' + fb +
                          ' Udemy Coupons ' + fm + sb + '<<' + fc + sd +
                          '-------\n')
                    while d <= limit:
                        list_st = udemy_coupons_me(d)
                        site = process(list_st, d, limit, site_index)
                        d += 1
                if site == 'Real Discount':
                    limit = 4
                    print('\n' + fc + sd + '-------' + fm + sb + '>>' + fb +
                          ' Real Discount ' + fm + sb + '<<' + fc + sd +
                          '-------\n')
                    while d <= limit:
                        list_st = real_disc(d)
                        site = process(list_st, d, limit, site_index)
                        d += 1
        elif input_1 == 'y':
            global count
            count = 0
            for index, items in enumerate(func_list):
                print('\n' + fc + sd + '-------' + fm + sb + '>> ' + fb +
                      total_sites[index] + fm + sb + ' <<' + fc + sd +
                      '-------\n')
                limit = site_range[index]
                for d in range(1, limit):
                    list_st = items(d)
                    auto_add(list_st, cookies, access_token, csrftoken)
Esempio n. 4
0
def main():

    sys.stdout.write(banner())

    product_id1 = input('Enter product id or Sale url: ')
    if '/in/goods/' in product_id1 or product_id1.isdigit():
        product_id = re.findall(r'\d+', product_id1)[0]
    else:
        print(
            '\nIncorrect Sale url\nSale Url should be like https://buy.realme.com/in/goods/188'
        )
        exit()
    all_cookies = input(
        'Enter cookie file(s) on which you want to order seprated with comma "," ex- cookie1.txt,cookie2.txt '
    )

    cookie_list = []

    regex = re.compile(',')
    if (regex.search(all_cookies) != None):
        c_ar = all_cookies.split(',')
        for c in c_ar:
            c = c.strip()
            cookie_file = Path('./my_cookies/' + c)
            if cookie_file.exists():
                cookie_list.append(c)
                added = 1
            else:
                added = 0
                print(
                    '\nSeems like your cookie file (' + c +
                    ') doesn\'t exists in my_cookies folder\nPlease add all your cookie files to my_cookies folder'
                )
                exit()
    else:
        cook = all_cookies.strip()
        cookie_file = Path('./my_cookies/' + cook)
        if cookie_file.exists():
            cookie_list.append(cook)
            added = 1
        else:
            added = 0
            print(
                '\nSeems like your cookie file (' + cook +
                ') doesn\'t exists in my_cookies folder\nPlease add all your cookie files to my_cookies folder'
            )
            exit()
    if added == 1:
        print('Cookie files added')
        s_year = input('Year as YYYY: ')
        s_month = input('Month as M: ')
        s_date = input('Date as D: ')
        s_hour = input('Hour as H: ')
        s_minute = input('Minute as M: ')
        pause.until(
            datetime(int(s_year), int(s_month), int(s_date), int(s_hour),
                     int(s_minute), 0))
        print(
            '\nNext step will be proceed at your provided time. Wait till then... '
        )
        for i in cookie_list:
            os.system('start cmd /k python realme.py -c ' + i + ' -id ' +
                      str(product_id))