Created
August 1, 2017 02:21
-
-
Save niranjanshr13/3b0b7a48193a499555c96acd9be1464e to your computer and use it in GitHub Desktop.
a command line for primewire.ag, which will work, just combine mpv $(youtube-dl -g). I was bored and starting coding. It is incomplete.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#{{{ Importing Modules | |
import requests | |
import bs4 | |
#}}} | |
#{{{ Variable's | |
assignment = {} | |
#}}} | |
''' | |
r = requests.get('https://www.primewire.ag/?tv').text # requesting page. | |
bs = bs4.BeautifulSoup(r, 'lxml') # converting to bs4 | |
divOnly = bs.findAll('div', {'class','index_item index_item_ie'}) # finding the div where it matter, | |
''' | |
baseUrl = 'https://www.primewire.ag/?tv' | |
def scraperSeries(scrapingMainPage): | |
r = requests.get(scrapingMainPage).text # requesting page. | |
bs = bs4.BeautifulSoup(r, 'lxml') # converting to bs4 | |
divOnly = bs.findAll('div', {'class','index_item index_item_ie'}) # finding the div where it matter, | |
for loop in range(len(divOnly)): | |
splitter = str(divOnly[loop]).split(' ')[3].split('"')[1] | |
splitterx = str(divOnly[loop]).split('=')[3].replace('Watch', '').strip('"><img alt') | |
print(str(loop) + ' ' + splitterx) | |
assignment[loop] = splitter | |
def scraperSeason(ScrapingPage): | |
r = requests.get('https://www.primewire.ag' + ScrapingPage).text | |
bs = bs4.BeautifulSoup(r, 'lxml') # converting to bs4 | |
divOnly = bs.findAll('a', {'class','season-toggle'}) # finding the div where it matter | |
lenofDiv = len(divOnly) | |
for loop in range(lenofDiv): | |
print(str(loop + 1) + ': ' + 'Season ' + str(loop + 1)) | |
def scraperEpisode(series, season): | |
r = requests.get('https://www.primewire.ag' + str(series).replace('watch', 'tv') + '/season-' + season).text | |
bs = bs4.BeautifulSoup(r, 'lxml') # converting to bs4 | |
divOnly = bs.findAll('div', {'class','tv_episode_item'}) # finding the div where it matter | |
print(divOnly) | |
if __name__ == '__main__': | |
scraperSeries(baseUrl) | |
chooserSeries = input() | |
scraperSeason(assignment[int(chooserSeries)]) | |
chooserSeason = input() | |
#scraperEpisode(str(assignment[int(chooserSeries)]), str(chooserSeason)) | |
#print(assignment[int(chooser)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment