Skip to content

Commit

Permalink
v1.0.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
idleloop-github committed Oct 24, 2014
1 parent 1da7b68 commit 02bd786
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.earthcam"
name="EarthCam"
version="1.0.7.2"
version="1.0.7.3"
provider-name="xbmchub.com, (forked by idleloop)">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
Expand Down
5 changes: 4 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
V1.0.7.1
v1.0.7.3
more cameras available

v1.0.7.1
(2014, Oct)
Code forked by idleloop
to fix no video at all
Expand Down
21 changes: 20 additions & 1 deletion channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#------------------------------------------------------------

#Code Upated by: Blazetamer 2014
#Code Upated by: idleloop @ 2014, Oct
#Code Updated by: idleloop @ 2014, Oct

import urlparse,urllib2,urllib,re
import os, sys
Expand Down Expand Up @@ -117,6 +117,8 @@ def cams(item):
if len(item_thereafter) == 1:
item=Item( action="play", title=title , url=item_thereafter[0].url, thumbnail=item_thereafter[0].thumbnail,
fanart=item_thereafter[0].fanart, plot=item_thereafter[0].plot, folder=False )
elif not item_thereafter: # hide empty menus :-(
continue
itemlist.append( item )

return itemlist
Expand All @@ -141,6 +143,23 @@ def previous_play(item, just_check=False):
try:
json_text = (re.search( r'json_base\s+\=\s*(.+);', data )).group(1)
except Exception, e:
pass
if len(json_text) < 100:
try:
# array of pages for deeper inspection throu new previous_play(): so new folder
cams = [m.groupdict() for m in
(re.finditer( r' href="(?P<url>index.php\?cam=[^"]+)">.+?<img src="(?P<thumbnail>[^"]+)".+?title="(?P<title>[^"]+)"',
data, flags=re.DOTALL))]
if not cams:
return []
if (DEBUG==True): logger.info("portal of cams=" + str(cams))
for cam_id in cams:
new_item=Item(action="previous_play", title=cam_id["title"] , url=item.url + cam_id["url"], thumbnail=cam_id["thumbnail"],
fanart=cam_id["thumbnail"], plot=cam_id["title"] )
itemlist.append( new_item )
return itemlist
except Exception, e:
logger.info("[earthcam] channel.py " + str(e))
return []
if (DEBUG==True): logger.info("json_text="+json_text)
json_decoded = urllib.unquote(json_text)
Expand Down

0 comments on commit 02bd786

Please sign in to comment.