Skip to content

Commit 897cc72

Browse files
committed
cartoonhd: fix tvshow matching
1 parent 08e9869 commit 897cc72

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/providers/video_index_tvdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def run(ump):
364364
dt = date.today()
365365
ws=time.strftime("%Y-%m-%d",(dt+timedelta(days=-7)).timetuple())
366366
we=time.strftime("%Y-%m-%d",(dt+timedelta(days=+7)).timetuple())
367-
ump.index_item("Last 2 Weeks","agenda",args={"seen":True,"start":ws,"end":we,"human":True})
367+
ump.index_item("Last + This Week","agenda",args={"seen":True,"start":ws,"end":we,"human":True})
368368
for i in range(8):
369369
day=dt+timedelta(days=i-1)
370370
if i== 0: dayname="Yesterday"

lib/providers/video_link_cartoonhd.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,16 @@ def run(ump):
5858
"sl":md5.new(slk.encode("base-64")[:-1]+search).hexdigest()
5959
}
6060
for result in json.loads(ump.get_page(domain+"/api/v2/cautare/"+search,encoding,data=d).encode("ascii","replace")):
61-
if ump.is_same(name,result["title"]) and (is_serie or ump.is_same(str(i["year"]),str(result["year"]))):
62-
found=True
63-
break
61+
meta=result["meta"].lower()
62+
if ump.is_same(name,result["title"]):
63+
if (is_serie and "show" in meta) or (not is_serie and "movie" in meta and ump.is_same(str(i["year"]),str(result["year"]))):
64+
found=True
65+
break
6466
if found:
6567
ump.add_log("cartoonhd has matched %s"%names[0])
6668
else:
6769
ump.add_log("cartoonhd can't match %s"%names[0])
6870
return
69-
7071
if is_serie:
7172
sourcepage=domain+result["permalink"]+"/season/%01d/episode/%01d"%(int(i["season"]),int(i["episode"]))
7273
else:

0 commit comments

Comments
 (0)