Skip to content

Instantly share code, notes, and snippets.

View VivekBits2210's full-sized avatar

Vivek Nayak VivekBits2210

View GitHub Profile
import urllib.parse
import urllib.request
BASE_URL = 'http://libgen.rs/search.php'
def libgen_post_request(query, pagenumber):
url_encoded_query = urllib.parse.urlencode({'req':query})
extra_params = '&open=0&res=25&view=simple&phrase=1&column=def&res=100'
libgen_current_page = f'&page={pagenumber}'
full_url = f'{BASE_URL}?{url_encoded_query}{extra_params}{libgen_current_page}'