Skip to content

Commit

Permalink
update to 3.1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
sshmanko committed Nov 15, 2017
1 parent 0f42715 commit 156007a
Show file tree
Hide file tree
Showing 99 changed files with 606 additions and 95 deletions.
6 changes: 6 additions & 0 deletions acestream-user.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
# acestreamengine user arguments :
################################################################################

export RUNAS=daemon:nogroup

ACE_USER_ARG="--log-debug 0 \
--login ACESTREAM_LOGIN \
--password ACESTREAM_PASSW \
--access-token WEBUIPASSWORD \
--bind-all \
--live-cache-type memory \
--live-cache-size 209715200 \
--cache-limit 60 \
--cache-dir /storage/.ACEStream \
--state-dir /storage/.ACEStream \
--vod-drop-max-age 120 \
--live-buffer 30 \
--vod-buffer 10 \
Expand All @@ -25,3 +30,4 @@ ACE_USER_ARG="--log-debug 0 \
--refill-buffer-interval 1 \
--core-skip-have-before-playback-pos 1 \
--webrtc-allow-outgoing-connections 1"

31 changes: 21 additions & 10 deletions acestream.start
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
#!/bin/sh
#!/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin

ACEADDON=$(readlink -f $(dirname $0))
ACECHROOT="androidfs"

if ! [ $(id -u) = 0 ]; then
PERMISSION=sudo
PERMISSION=sudo
fi

if mount | grep -E "( $ACEADDON/$ACECHROOT/proc | $ACEADDON/$ACECHROOT/sys | $ACEADDON/$ACECHROOT/dev )" >/dev/null; then

$PERMISSION pkill -9 -f "/system/data/data/org.acestream.engine/files/python/bin/python" &>/dev/null
$PERMISSION pkill -9 -f "/system/bin/acestream.sh" &>/dev/null
$PERMISSION umount $ACEADDON/$ACECHROOT/proc
$PERMISSION umount $ACEADDON/$ACECHROOT/sys
$PERMISSION umount $ACEADDON/$ACECHROOT/dev
sleep 2
if [ $? -eq 0 ]; then
$PERMISSION pkill -9 -f "/system/data/data/org.acestream.engine/files/python/bin/python" &>/dev/null
$PERMISSION pkill -9 -f "/system/bin/acestream.sh" &>/dev/null
#unmount directories
$PERMISSION umount $ACEADDON/$ACECHROOT/proc &>/dev/null
$PERMISSION umount $ACEADDON/$ACECHROOT/sys &>/dev/null
$PERMISSION umount $ACEADDON/$ACECHROOT/dev &>/dev/null
sleep 2
fi
fi

$PERMISSION mkdir -p $ACEADDON/$ACECHROOT/system
$PERMISSION mkdir -p $ACEADDON/$ACECHROOT/storage
$PERMISSION mkdir -p $ACEADDON/$ACECHROOT/dev
$PERMISSION mkdir -p $ACEADDON/$ACECHROOT/proc
$PERMISSION mkdir -p $ACEADDON/$ACECHROOT/sys
Expand All @@ -26,7 +30,14 @@ $PERMISSION mount -o bind /dev $ACEADDON/$ACECHROOT/dev &>/dev/null
$PERMISSION mount -t proc proc $ACEADDON/$ACECHROOT/proc &>/dev/null
$PERMISSION mount -t sysfs sysfs $ACEADDON/$ACECHROOT/sys &>/dev/null

$PERMISSION chroot $ACEADDON/$ACECHROOT /system/bin/sh -c "cd /system/data/data/org.acestream.engine/files ; /system/bin/acestream.sh" > $ACEADDON/acestream.log 2>&1 - << EOF
$PERMISSION chown -R root:root $ACEADDON/$ACECHROOT/system
$PERMISSION find $ACEADDON/$ACECHROOT/system -type d -exec chmod 755 {} \;
$PERMISSION find $ACEADDON/$ACECHROOT/system -type f -exec chmod 644 {} \;
$PERMISSION chmod 755 $ACEADDON/$ACECHROOT/system/bin/* $ACEADDON/$ACECHROOT/system/data/data/org.acestream.engine/files/python/bin/python
[ -n "$RUNAS" ] && $PERMISSION chown -R $RUNAS $ACEADDON/$ACECHROOT/storage

[ -n "$RUNAS" ] && USERSPEC="--userspec=$RUNAS"
$PERMISSION chroot $USERSPEC $ACEADDON/$ACECHROOT /system/bin/sh -c "cd /system/data/data/org.acestream.engine/files ; /system/bin/acestream.sh" > $ACEADDON/acestream.log 2>&1 - << EOF
from acestreamengine import Core
Expand Down
4 changes: 2 additions & 2 deletions androidfs/system/bin/acestream.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/system/bin/sh
#/system/bin/ps aux

export ANDROID_ROOT=/system
export ANDROID_DATA=/data
export ANDROID_DATA=/system/data
export ANDROID_STORAGE=/storage
export PYTHONHOME=/system/data/data/org.acestream.engine/files/python
export PYTHONPATH=/system/data/data/org.acestream.engine/files/python/lib/python2.7/lib-dynload:/system/data/data/org.acestream.engine/files/python/lib/python2.7
Expand Down
Binary file added androidfs/system/bin/linker64
Binary file not shown.
Binary file added androidfs/system/bin/toolbox
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
#-plugin-sig:fkASsQP1P8P64o/mQsdfdV2GA5EuM8tTZd7o3zbqE6lf8fiee/5DlbWvvwD++DykwhwC8dQsAXBK+6+r4ObDAUucnxKoIgVpRFIZlbSDuEHZxwqOSk0PpCTriWJhquJY0KyzAQZrs9tEnfhDFzttk76+Qj1aeBF1JG8Gf7dSRZ/lonwWsuDkXgVvP7ue1jA8PUGLItV5aFl/mvFlrtU3C0c6ugsGiGetBs17povXFoJu5FDkmTkBLnesO2YhX8xEL7Pf5auM7KryrxIr/AWZR8hlTpKYQ/XfYFOBMVXwQeJuzHAl4Dq3aL3XW3ycMMzk/sAjvSEVUOs/sE3jNc728w==
#-plugin-sig:kPbSffKXouE5EsrU8SGiE6ugjbXpj65qWORCNhzKxXRq7dGERN5xTqhccEyANA/FpSseC6K2i6A+0yPUKaaMP6GHj4TspdMyI017snpFye9WRWQvAcvjxU3C/TnmdNezRPVRqBqH+jc6eS5JwXEWnvk0Ww8pZPu8GJxVYorjz1h2djMAH8WMDAqMREuX74vpIFp02SaCXtnddIr7+uq0jdVVfMmM3pFkn/QA+aDc8mouTUk+NJ/d+RrY4yY1mZLMkHhIxliJ0yY2yost5t5D2UYI46qB3habMGp6R9AsfcQwZCU/qsLQ64KytksnOSGbSm0Ftzs1r1kWWD35//l8+w==
import json
import requests

Expand Down Expand Up @@ -64,7 +64,7 @@ def _get_stream_url(self, o):
channel_info = requests.get(stream_video_url.format(channel))
j = json.loads(channel_info.text)

if j["data"]["is_live"] != True:
if 'data' in j and 'is_live' in j["data"] and j["data"]["is_live"] != True:
return "", False
else:
is_live = True
Expand Down Expand Up @@ -95,4 +95,4 @@ def _get_streams(self):

return streams

__plugin__ = AzubuTV
__plugin__ = AzubuTV
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#-plugin-sig:SPqmmxqEioOfeS09AvinJJrjqKG+0bWkTFbOIOKFAw0XnyVa9j4iwtcaHT3KhdleQaWufDZrQ5C0Tw3Jjp4KPxt//MK4Oex/71zqgWmhIGeJfN0iRroTovVdcuB5QTEg3hw9ddGbmOtHbX99qkJ92AGO4PCbRuU3lQuUJemoPuf2AH6rFlYbQLTC28B/USEhV75ySlp/BpmVwJgDKfyxOvPVzHnlcdFQms/Z72qrQZAiwkkYdSKqkOz7FJi/1VhTVe/wmTkwCkK6Est3V04FOVB5gi/C1/4wKrmMqjKnTjsF36p0QA5gu40bs35eyMK0Ely4wsgSpo9H45YN283W6A==
import re

from ACEStream.PluginsContainer.livestreamer.plugin import Plugin
from ACEStream.PluginsContainer.livestreamer.stream import HLSStream

_playlist_url = "https://www.facebook.com/video/playback/playlist.m3u8?v={0}"

_url_re = re.compile(r"http(s)?://(www\.)?facebook\.com/[^/]+/videos/(?P<video_id>\d+)")


class Facebook(Plugin):
@classmethod
def can_handle_url(cls, url):
return _url_re.match(url)

def _get_streams(self):
match = _url_re.match(self.url)
video = match.group("video_id")

playlist = _playlist_url.format(video)

return HLSStream.parse_variant_playlist(self.session, playlist)

__plugin__ = Facebook
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#-plugin-sig:RH03aHgiSALoPxVbSU8jVbqBS309gYLuKXjTZwi8XmJ4GEvG0fzri0XIbADu/2DovxrP0j6kpUpjFjdoz57sCFOAB+XLruY1Y/gvi+yZhQKeHRHL3MKgkhIkxhMHDignfjXY142XEMGoPKZor+lVw93OwtZ7MLt0hT4yMdr9iZ61DDUZ+Knx8urQMwSJo0kVC4v/jfJXuSAx03++evhqKoSetw1RQAgLPZc31s0q2Bg1Sf+MTFoOcTDtB8WmHMDBYtDnBztWO88Osy9D06YLFoOWtcRbpILIQzrvm3XnUC9hsKOyMXgooQyzdVonyFzOxRBNx7Chfl9yqXrldWo8gg==
import re

from ACEStream.PluginsContainer.livestreamer.plugin import Plugin, PluginError
from ACEStream.PluginsContainer.livestreamer.plugin.api import http
from ACEStream.PluginsContainer.livestreamer.stream import HTTPStream, HLSStream

# https://embed.life.ru/video/dc020486e0248fd466cc4c153c92b1a1
_url_re = re.compile(r"http(s)?:\/\/(?:www\.)?(embed\.)life\.ru\/video\/(?P<id>[a-z,A-Z,0-9]+)")
# "original":"https://static.life.ru/dc020486e0248fd466cc4c153c92b1a1.mp4"
_direct_url = re.compile(r"\"original\":\"(?P<url>http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)\"")
# User-agent to use for http requests
USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36'

class life_ru(Plugin):
@classmethod
def can_handle_url(cls, url):
return _url_re.match(url)

def _get_streams(self):
match = _url_re.match(self.url)
videoid = match.group('id')

# Set header data for user-agent
hdr = {'User-Agent': USER_AGENT}

# Parse video ID from data received from supplied URL
res = http.get(self.url, headers=hdr)

if not res:
return {}

for match in re.findall(_direct_url, res.text):
try:
return {"original" : HTTPStream(self.session, match)}
except Exception as e:
self.logger.error("Failed to extract video url: {0}", e)

return {}
__plugin__ = life_ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#-plugin-sig:ivQafMxeUDQ6g4K2k+E/46NCo2WdNF0EUxkciCL9f5DU3PEU/Q5az8X9VAG7LFhPQ87PSAI7iOTCOTiQWLe21M9xneeXP/FEJBN6XNZa1oJHjXbA1CHybHCnL+tdOuj8dUm1D+DmFcNEgmgUcxoHw3ZhTEkq+l4EBKCWpHVyV9jgrpjUZeUW6ZV9GwaoKVA7GmTleIXGUeW7/zCb7tsTAmNjr1DoNPoQBJuhJxDstgsXq/np/YYL8IT64yu6gyJ7p56gPZjjtBcECZrdT3beBOWud3xPHOR31brOhEFmcwimm4upkbAd6eDhZVM5g9fFx24EQQ93s/4mbJJQp/0LEg==
import re
import base64
import json

from ACEStream.PluginsContainer.livestreamer.plugin import Plugin, PluginError
from ACEStream.PluginsContainer.livestreamer.plugin.api import http
from ACEStream.PluginsContainer.livestreamer.stream import HTTPStream, HLSStream

# https://ovva.tv/video/embed/EuDTKiaN?logo=tsn&l=ua&autoplay=0
_url_re = re.compile(r"http(s)?:\/\/(?:www\.)?ovva\.tv\/.*embed\/(?P<id>[a-z,A-Z,0-9]+)")
_player_params = re.compile(r"\$\(\'\#ovva-player\'\)\.ovva\(\'(?P<base64>.*)\'\);")
# User-agent to use for http requests
USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36'

class ovva(Plugin):
@classmethod
def can_handle_url(cls, url):
return _url_re.match(url)

def _get_streams(self):
match = _url_re.match(self.url)
videoid = match.group('id')

# Set header data for user-agent
hdr = {'User-Agent': USER_AGENT}

# Parse video ID from data received from supplied URL
res = http.get(self.url, headers=hdr)

if not res:
return {}

for match in re.findall(_player_params, res.text):
try:
params = json.loads(base64.b64decode(match))
video_url = params.get("url")
res = http.get(video_url, headers=hdr)

video_url = res.text.split('=')[1]

return HLSStream.parse_variant_playlist(self.session, video_url)
except Exception as e:
self.logger.error("Failed to decode player params: {0}", e)

return {}
__plugin__ = ovva
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#-plugin-sig:bgDY7DWi3fwE5GZYhj1rmVictYmEZY2qEoP/UNsTortaooXEi7gGfKaR/9zsXeWGdfpdayCa5uD+Uz+/CnZ4PcNGzqZbGnNDLOb/agvHNGrf9WduKW+84eZtT+SrnpPMLG8JHuw/rC4t62snd1oKXhXXPN7P7/uWzTR0lEtJWIYFh6RH1qM7SiDzg+u5DSZ46ptfQki1juKtYbPUWwbcG2GEBQmVq4mBaQB72/j56tt7N9bpKZ3mc7JD1sRedKxgm23SHmyy0chlo0c8oHNJgiqq+/x6BYXkovKE25X/YTwW4fpk/xp1aLl2vBPMLv1yULAPm3HKcnbzlzdeGe0Nvg==
import re

from ACEStream.PluginsContainer.livestreamer.plugin import Plugin, PluginError
from ACEStream.PluginsContainer.livestreamer.plugin.api import http
from ACEStream.PluginsContainer.livestreamer.stream import HTTPStream, HLSStream

from bs4 import NavigableString, BeautifulSoup, Comment

# http://video.shakhtar.com/ru/embed/v8888
_url_re = re.compile(r"http(s)?:\/\/video\.shakhtar\.com\/.*embed\/*")
# User-agent to use for http requests
USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36'

class shakhtar(Plugin):
@classmethod
def can_handle_url(cls, url):
return _url_re.match(url)

def _get_streams(self):
# Set header data for user-agent
hdr = {'User-Agent': USER_AGENT}

# Parse video ID from data received from supplied URL
res = http.get(self.url, headers=hdr)

if not res:
return {}

try:
bs = BeautifulSoup(res.text, "html5lib")
bs = bs.find('video', {'id' : "my-video"})

if not bs:
return {}

src = bs.find('source', {'data-quality' : "hd"})

if not src:
src = bs.find('video')

if not src or not src.get('src'):
return {}

return {"best" : HTTPStream(self.session, src.get('src'))}
except Exception as e:
self.logger.error("Failed to decode player params: {0}", e)

return {}

__plugin__ = shakhtar
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#-plugin-sig:E0XZW6X5BGUsNe6MrioYxM855MFshxF5Ig4XR6e2LcIAGWT47BaOTyv1HjjGS7YzYKrahWV65uSPSYx3Gwn5PE7+UeNQie6i6axel4QiXfF134vfkzbKSURKD3jN5cJOw/7wyVPU2vzdReInmDRMTJCPvsD2JebmUsR9o1KfWZh3ev1WhN3mmBU2IOJWp9iinXMauUuV2hscfb5mx2KOApTwGAFqhk/TdIQHffMqbcAE9a/S+flbLGyKFqS4YSxOASikalRK+jJqPpLQGHbaOkgL+DBhtPdCJlkySYqCV0tI2dCOwaZ9d5AuL2ZOL9r1xPY6NlnKYKMl3dS8P7WcSg==
#-plugin-sig:jNYmRAgphTqebdyVRuEYx/DZbFP6UEJp4J22+58sHpPfAn2HwPJKyHsi8xaMaAwcqYkpHoGRtR+mN/TEB147CGpzwOijJmdcjHjahZitFeBdfyVMMt0gvOegBX8KCBLlVceoD61PHK8zYpwxZCHwoCs1KI5NbZJjMK+SgWlsd2u0TimQddL2U65jfYftT7MWI9rBwNBQkPFvAlOmQj1cpJ/jhY6p/LdjirCKiFsSKIBmSwuRi3/eba/wTasNSxOPlg94jez8EmRKBlQ08eQhBwTOs0AVhrArgAkx6Oq5/S+N3fvXjSM4gtDbM2/7v25zC7ACEahiRn/zFlNFavGkMw==
import re
import time

Expand All @@ -15,7 +15,7 @@ def can_handle_url(self, url):
def _get_streams(self):
# sleep and return youtube vod
time.sleep(3.0)
url = "https://youtu.be/scWpXEYZEGk"
url = "https://youtu.be/-xC6b108_P4"
return self.session.streams(url)


Expand Down
Loading

0 comments on commit 156007a

Please sign in to comment.