Skip to content

Commit

Permalink
Desi Dabba Tv + URL Services
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-alpha committed Oct 2, 2015
1 parent 05c9620 commit 7fca497
Show file tree
Hide file tree
Showing 11 changed files with 518 additions and 34 deletions.
2 changes: 2 additions & 0 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import apnitv
import desitvforum
import updater
import desitvbox

PREFIX = common.PREFIX
NAME = common.NAME
Expand All @@ -29,6 +30,7 @@ def Start():
@handler(PREFIX, NAME, art=ART, thumb=ICON)
def MainMenu():
oc = ObjectContainer()
oc.add(DirectoryObject(key=Callback(desitvbox.ChannelsMenu, url=desitvbox.SITEURL), title=desitvbox.SITETITLE, thumb=R(desitvbox.SITETHUMB)))
oc.add(DirectoryObject(key=Callback(desirulez.TypeMenu, url=desirulez.SITEURL), title=desirulez.SITETITLE, thumb=R(desirulez.SITETHUMB)))
oc.add(DirectoryObject(key=Callback(apnitv.ChannelsMenu, url=apnitv.SITEURL), title=apnitv.SITETITLE, thumb=R(apnitv.SITETHUMB)))
oc.add(DirectoryObject(key=Callback(desitvforum.TypeMenu, url=desitvforum.SITEURL), title=desitvforum.SITETITLE, thumb=R(desitvforum.SITETHUMB)))
Expand Down
20 changes: 15 additions & 5 deletions Contents/Code/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
TITLE = L('Title')
VERSION = '0.05' # Release notation (x.y - where x is major and y is minor)
VERSION = '0.06' # Release notation (x.y - where x is major and y is minor)
GITHUB_REPOSITORY = 'coder-alpha/DesiTV.bundle'
PREFIX = "/video/desitv"
################################################################################
Expand Down Expand Up @@ -72,6 +72,12 @@
ANDTV = '& Tv'
EPIC = 'EPIC'

# DesiBoxTv
ANDTV2 = 'And TV'
SONYPAL2 = 'Pal'
MTVIN2 = 'MTV'
ZINDAGITV2 = 'Zindagi'

####################################################################################################

def GetSupportedChannels():
Expand Down Expand Up @@ -133,6 +139,10 @@ def GetSupportedChannels():
FIRANGI.lower(),
ZEEMUZIC.lower(),
ANDTV.lower(),
ANDTV2.lower(),
SONYPAL2.lower(),
MTVIN2.lower(),
ZINDAGITV2.lower(),
EPIC.lower()
]

Expand All @@ -159,7 +169,7 @@ def GetThumb(channel):
icon = R('icon-sabtv.png')
elif channel == STARPRAVAH.lower():
icon = R('icon-starpravah.png')
elif channel == MTV.lower() or channel == MTVIN.lower():
elif channel == MTV.lower() or channel == MTVIN.lower() or channel == MTVIN2.lower():
icon = R('icon-mtv.png')
elif channel == CHANNELV.lower() or channel == CHANNELVV.lower():
icon = R('icon-channelv.png')
Expand All @@ -175,11 +185,11 @@ def GetThumb(channel):
icon = R('icon-9xinxmedia.png')
elif channel == NDTV.lower():
icon = R('icon-ndtv.png')
elif channel == SONYPAL.lower():
elif channel == SONYPAL.lower() or channel == SONYPAL2.lower():
icon = R('icon-sonypal.png')
elif channel == DDNATIONAL.lower():
icon = R('icon-ddnational.png')
elif channel == ZINDAGITV.lower():
elif channel == ZINDAGITV.lower() or channel == ZINDAGITV2.lower():
icon = R('icon-zindagitv.png')
elif channel == BIGMAGIC.lower():
icon = R('icon-bigmagic.png')
Expand Down Expand Up @@ -243,7 +253,7 @@ def GetThumb(channel):
icon = R('icon-firangi.png')
elif channel == ZEEMUZIC.lower():
icon = R('icon-zeemuzic.png')
elif channel == ANDTV.lower():
elif channel == ANDTV.lower() or channel == ANDTV2.lower():
icon = R('icon-&TV.png')
elif channel == EPIC.lower():
icon = R('icon-epic.png')
Expand Down
27 changes: 18 additions & 9 deletions Contents/Code/desirulez.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ def PlayerLinksMenu(url, title, type):

# Add the item to the collection
if type == "TV":
oc.add(DirectoryObject(key=Callback(EpisodeLinksMenu, url=url, title=title, type=L('LetWatchUS-HD')), title=L('LetWatchUS-HD'), thumb=R('icon-letwatchus.png')))
oc.add(DirectoryObject(key=Callback(EpisodeLinksMenu, url=url, title=title, type=L('LetWatchUS-DVD')), title=L('LetWatchUS-DVD'), thumb=R('icon-letwatchus.png')))
oc.add(DirectoryObject(key=Callback(EpisodeLinksMenu, url=url, title=title, type='LetWatchUS'), title='LetWatchUS', thumb=R('icon-letwatchus.png')))
oc.add(DirectoryObject(key=Callback(EpisodeLinksMenu, url=url, title=title, type=L('DailymotionHD')), title=L('DailymotionHD'), thumb=R('icon-dailymotion.png')))
oc.add(DirectoryObject(key=Callback(EpisodeLinksMenu, url=url, title=title, type=L('DailymotionDVD')), title=L('DailymotionDVD'), thumb=R('icon-dailymotion.png')))
oc.add(DirectoryObject(key=Callback(EpisodeLinksMenu, url=url, title=title, type=L('DailymotionSD')), title=L('DailymotionSD'), thumb=R('icon-dailymotion.png')))
Expand Down Expand Up @@ -330,10 +329,8 @@ def EpisodeLinksMenu(url, title, type):
# Summary
summary = GetSummary(html)

if type == "LetWatchUS-HD":
if type == "LetWatchUS":
items = GetLetwatchusHD(html)
elif type == "LetWatchUS-DVD":
items = GetLetwatchusDVD(html)
elif type == "Dailymotion HD":
items = GetDailymotionHD(html)
elif type == "Dailymotion DVD":
Expand All @@ -348,8 +345,9 @@ def EpisodeLinksMenu(url, title, type):
items = None

links = []
count=0

for item in items:

try:
# Video site
videosite = item.xpath("./text()")[0]
Expand All @@ -359,6 +357,8 @@ def EpisodeLinksMenu(url, title, type):
if link.startswith("http") == False:
link = link.lstrip('htp:/')
link = 'http://' + link
if len(links) > 1 and link.find('Part 1') != -1:
break
# Show date
date = GetShowDate(videosite)
# Get video source url and thumb
Expand All @@ -373,7 +373,16 @@ def EpisodeLinksMenu(url, title, type):
originally_available_at = ''

# Add the found item to the collection
if link.find('dailymotion') != -1 or link.find('vidshare') != -1:
if link.find('vidshare') != -1:
links.append(URLService.NormalizeURL(link))
#Log ('LetwatchUS Link: ' + link)
oc.add(VideoClipObject(
url = link,
title = videosite,
thumb = Resource.ContentsOfURLWithFallback(thumb, fallback=R(ICON)),
summary = summary,
originally_available_at = originally_available_at))
elif link.find('dailymotion') != -1:
links.append(URLService.NormalizeURL(link))
#Log ('Dailymotion Link: ' + link)
oc.add(VideoClipObject(
Expand Down Expand Up @@ -491,9 +500,9 @@ def GetTvURLSource(url, referer, date=''):
####################################################################################################

def GetLetwatchusHD(html):
items = html.xpath("//div[@class='content']//b[contains(font/text(),'Letwatch 720p')]/following-sibling::a[count(. | //b[count(//b[contains(font/text(),'Letwatch 720p')]/preceding-sibling::b)+2]/preceding-sibling::a) = count(//b[count(//b[contains(font/text(),'Letwatch 720p')]/preceding-sibling::b)+2]/preceding-sibling::a)]")
items = html.xpath("//div[@class='content']//b[contains(font/text(),'Letwatch')]/following-sibling::a[count(. | //b[count(//b[contains(font/text(),'Letwatch')]/preceding-sibling::b)+2]/preceding-sibling::a) = count(//b[count(//b[contains(font/text(),'Letwatch')]/preceding-sibling::b)+2]/preceding-sibling::a)]")
if len(items) == 0:
items = html.xpath("//div[@class='content hasad']//b[contains(font[@color='Red']//text(), 'Letwatch 720p')]//following-sibling::a")
items = html.xpath("//div[@class='content hasad']//b[contains(font[@color='Red']//text(), 'Letwatch')]//following-sibling::a")
return items

####################################################################################################
Expand Down
Loading

0 comments on commit 7fca497

Please sign in to comment.