hello @samasamsam ...
I work on a small beautiful site, faithfully broadcast matches directly , personally I perfect score !
Here website: http://www.yalla-shoot.com/live/
and that py file dedicated to you
========================================================================================
# tigrousad
#
# Yalla-shoot
#
#
# Only Soccer on this site.
raw_category = "Soccer"
def init():
return {
'protocol': 'yalla-shoot',
'hostname': 'yalla-shoot.com',
'regex' : '',
'httpDelay': [1, 3],
}
def url(url):
setPageLoadTimeout( 90 )
#'-vs-' appears in stream links
if '-vs-' in url:
parse_streampage(url)
else:
parse_schedulepage(url)
# Iframes of streams do not appear when testing
# Seems that scripts are hiding the iframes
# Link to embedded stream retrieved
def parse_streampage(url):
load(url)
try:
# Taking raw asset from URL
raw_asset = url[37:-5]
#raw_subcategory_elems=findAll('table table td')
#raw_subcategory = raw_subcategory_elems[2].text
# clickable tabs for streams
tabs = findAll('ul.nav li')
sources = []
for tab in tabs:
moveMouseToElement(tab)
clickMouse()
#wait(5) # letting elements load
# Iframe contains embed link
raw_iframe_src = find('div.convi iframe')
iframe_embed_src = queryAttrib('src', raw_iframe_src)
sources.append(iframe_embed_src)
for source in sources:
#Storing current data before loading the embedded link
store('linking_site_url', url)
store('raw_category',raw_category)
store('raw_asset',raw_asset)
#store('raw_subcategory', raw_subcategory)
store('hosting_site_url', source)
store('url',url)
store('type','linking_site_url')
flush()
except Exception as genErr:
err( genErr )
def parse_schedulepage(url):
load(url)
try:
#Layout is strange, table within table etc.
#Grabbing items into arrays - indexing easier
#Some slicing to match up with events
events = findAll('div.matsh li')
raw_teamnames = findAll('td.fc_name')
raw_subcategories = findAll('div.matsh li p')
# Subcategory every 3rd <p> element, skip first 2
raw_subcategory = raw_subcategories[2::3]
raw_links = findAll('div.matsh a.matsh_live[href]')
# teams are same class but different td
# so storing all of them allows for
# team1,team2,team1,team2 etc
team1 = raw_teamnames[1::2]
team2 = raw_teamnames[:-1:2]
for index,event in enumerate(events):
try:
live_test = find('span.matsh_start', event)
except Exception:
continue
# raw asset can also be taken from linking site url
# however this is more "raw"
raw_asset = team1[index].text+" - "+team2[index].text
store('url',url)
store('raw_asset',raw_asset)
store('raw_category', raw_category)
store('raw_subcategory',raw_subcategory[index].text)
#index keeps data lined up
linking_site_url_element = raw_links[index]
linking_site_url = queryAttrib('href',linking_site_url_element)
store('linking_site_url',linking_site_url)
store('type','search_result')
store('new_job',linking_site_url)
flush()
except Exception as genErr:
err( genErr )
===============================================================================================
I want to see this beautiful site in your next update
thank u