Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
IslandJohn committed Dec 31, 2015
1 parent 4c68197 commit bd18c2b
Show file tree
Hide file tree
Showing 13 changed files with 281 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 techiejohn/pilotjohn at gearsdown.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
52 changes: 52 additions & 0 deletions plugin.video.DunaTV/addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os
import time
import urllib
import xbmc
import xbmcaddon
from BeautifulSoup import BeautifulSoup

print "Starting..."

# setup
cs_url = "http://admin.gamaxmedia.hu/player-inside-full?streamid=dunalive&userid=mtva"
cs_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25"
cs_name = xbmcaddon.Addon().getAddonInfo("id")
cs_file = os.path.join(xbmc.translatePath("special://temp"), cs_name + ".session")
cs_delay = 5

class CsatornakURLopener(urllib.FancyURLopener):
version = cs_agent

print "Session: " + cs_file

# tries to limit deadlocks due to multiple runs
# fcntl for file locking may not be available on some platforms
if os.path.exists(cs_file) and time.time() - os.path.getmtime(cs_file) < cs_delay:
print "Recently ran, exiting."
sys.exit(0)
else:
with open(cs_file, "a+"):
os.utime(cs_file, None)

cs_player = xbmc.Player()

# stop playing and wait
cs_player.stop()
while cs_player.isPlaying():
xbmc.sleep(10)

# load and parse stream
print "Loading: " + cs_url

urllib._urlopener = CsatornakURLopener()
cs_page = urllib.urlopen(cs_url)
cs_soup = BeautifulSoup(cs_page.read())

cs_page.close()

cs_stream = cs_soup.source['src']

# play stream
print "Playing: " + cs_stream
cs_player.play(cs_stream)
print "Done."
13 changes: 13 additions & 0 deletions plugin.video.DunaTV/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.DunaTV" name="DunaTV" version="0.0.1" provider-name="IslandJohn">
<requires>
<import addon="xbmc.python" version="2.6.0"/>
<import addon="script.module.beautifulsoup" version="3.2.1"/>
</requires>
<extension point="xbmc.python.script" library="addon.py" />
<extension point="xbmc.addon.metadata">
<summary>Duna TV</summary>
<description>Stream Duna TV live.</description>
<platform>all</platform>
</extension>
</addon>
Binary file added plugin.video.DunaTV/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions plugin.video.DunaWorld/addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os
import time
import urllib
import xbmc
import xbmcaddon
from BeautifulSoup import BeautifulSoup

print "Starting..."

# setup
cs_url = "http://admin.gamaxmedia.hu/player-inside-full?streamid=dunaworldlive&userid=mtva"
cs_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25"
cs_name = xbmcaddon.Addon().getAddonInfo("id")
cs_file = os.path.join(xbmc.translatePath("special://temp"), cs_name + ".session")
cs_delay = 5

class CsatornakURLopener(urllib.FancyURLopener):
version = cs_agent

print "Session: " + cs_file

# tries to limit deadlocks due to multiple runs
# fcntl for file locking may not be available on some platforms
if os.path.exists(cs_file) and time.time() - os.path.getmtime(cs_file) < cs_delay:
print "Recently ran, exiting."
sys.exit(0)
else:
with open(cs_file, "a+"):
os.utime(cs_file, None)

cs_player = xbmc.Player()

# stop playing and wait
cs_player.stop()
while cs_player.isPlaying():
xbmc.sleep(10)

# load and parse stream
print "Loading: " + cs_url

urllib._urlopener = CsatornakURLopener()
cs_page = urllib.urlopen(cs_url)
cs_soup = BeautifulSoup(cs_page.read())

cs_page.close()

cs_stream = cs_soup.source['src']

# play stream
print "Playing: " + cs_stream
cs_player.play(cs_stream)
print "Done."
13 changes: 13 additions & 0 deletions plugin.video.DunaWorld/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.DunaWorld" name="DunaWorld" version="0.0.1" provider-name="IslandJohn">
<requires>
<import addon="xbmc.python" version="2.6.0"/>
<import addon="script.module.beautifulsoup" version="3.2.1"/>
</requires>
<extension point="xbmc.python.script" library="addon.py" />
<extension point="xbmc.addon.metadata">
<summary>Duna World</summary>
<description>Stream Duna World live.</description>
<platform>all</platform>
</extension>
</addon>
Binary file added plugin.video.DunaWorld/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions plugin.video.MTV1/addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os
import time
import urllib
import xbmc
import xbmcaddon
from BeautifulSoup import BeautifulSoup

print "Starting..."

# setup
cs_url = "http://admin.gamaxmedia.hu/player-inside-full?streamid=mtv1live&userid=mtva"
cs_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25"
cs_name = xbmcaddon.Addon().getAddonInfo("id")
cs_file = os.path.join(xbmc.translatePath("special://temp"), cs_name + ".session")
cs_delay = 5

class CsatornakURLopener(urllib.FancyURLopener):
version = cs_agent

print "Session: " + cs_file

# tries to limit deadlocks due to multiple runs
# fcntl for file locking may not be available on some platforms
if os.path.exists(cs_file) and time.time() - os.path.getmtime(cs_file) < cs_delay:
print "Recently ran, exiting."
sys.exit(0)
else:
with open(cs_file, "a+"):
os.utime(cs_file, None)

cs_player = xbmc.Player()

# stop playing and wait
cs_player.stop()
while cs_player.isPlaying():
xbmc.sleep(10)

# load and parse stream
print "Loading: " + cs_url

urllib._urlopener = CsatornakURLopener()
cs_page = urllib.urlopen(cs_url)
cs_soup = BeautifulSoup(cs_page.read())

cs_page.close()

cs_stream = cs_soup.source['src']

# play stream
print "Playing: " + cs_stream
cs_player.play(cs_stream)
print "Done."
13 changes: 13 additions & 0 deletions plugin.video.MTV1/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.MTV1" name="MTV1" version="0.0.1" provider-name="IslandJohn">
<requires>
<import addon="xbmc.python" version="2.6.0"/>
<import addon="script.module.beautifulsoup" version="3.2.1"/>
</requires>
<extension point="xbmc.python.script" library="addon.py" />
<extension point="xbmc.addon.metadata">
<summary>MTV 1</summary>
<description>Stream MTV 1 live.</description>
<platform>all</platform>
</extension>
</addon>
Binary file added plugin.video.MTV1/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions plugin.video.MTV2/addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os
import time
import urllib
import xbmc
import xbmcaddon
from BeautifulSoup import BeautifulSoup

print "Starting..."

# setup
cs_url = "http://admin.gamaxmedia.hu/player-inside-full?streamid=mtv2live&userid=mtva"
cs_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25"
cs_name = xbmcaddon.Addon().getAddonInfo("id")
cs_file = os.path.join(xbmc.translatePath("special://temp"), cs_name + ".session")
cs_delay = 5

class CsatornakURLopener(urllib.FancyURLopener):
version = cs_agent

print "Session: " + cs_file

# tries to limit deadlocks due to multiple runs
# fcntl for file locking may not be available on some platforms
if os.path.exists(cs_file) and time.time() - os.path.getmtime(cs_file) < cs_delay:
print "Recently ran, exiting."
sys.exit(0)
else:
with open(cs_file, "a+"):
os.utime(cs_file, None)

cs_player = xbmc.Player()

# stop playing and wait
cs_player.stop()
while cs_player.isPlaying():
xbmc.sleep(10)

# load and parse stream
print "Loading: " + cs_url

urllib._urlopener = CsatornakURLopener()
cs_page = urllib.urlopen(cs_url)
cs_soup = BeautifulSoup(cs_page.read())

cs_page.close()

cs_stream = cs_soup.source['src']

# play stream
print "Playing: " + cs_stream
cs_player.play(cs_stream)
print "Done."
13 changes: 13 additions & 0 deletions plugin.video.MTV2/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.MTV2" name="MTV2" version="0.0.1" provider-name="IslandJohn">
<requires>
<import addon="xbmc.python" version="2.6.0"/>
<import addon="script.module.beautifulsoup" version="3.2.1"/>
</requires>
<extension point="xbmc.python.script" library="addon.py" />
<extension point="xbmc.addon.metadata">
<summary>MTV 2</summary>
<description>Stream MTV 2 live.</description>
<platform>all</platform>
</extension>
</addon>
Binary file added plugin.video.MTV2/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bd18c2b

Please sign in to comment.