Skip to content

Commit

Permalink
Merge branch '79-update-acelink'
Browse files Browse the repository at this point in the history
  • Loading branch information
blaise-io committed May 6, 2024
2 parents 0291aff + d2cce81 commit aee2cad
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Ace Link/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.6</string>
<string>2.1.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
2 changes: 1 addition & 1 deletion Ace Link/Services/AceStreamEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class AceStreamEngine: Service {
"--publish=\(AppConstants.Docker.proxyPort):\(AppConstants.Docker.proxyPort)",
"--name=\(AppConstants.Docker.containerName)",
AppConstants.Docker.image,
"/opt/acestream/start-engine",
"--client-console",
"--access-token=\(token)",
"--allow-user-config",
Expand All @@ -45,6 +44,7 @@ class AceStreamEngine: Service {
override func check() {
let serverURL = AppConstants.Docker.baseURL
.appendingPathComponent("/webui/app/\(token)/server")
os_log("Check server up at %{public}@ …", serverURL.absoluteString)
urlSession.dataTask(with: serverURL) { data, _, _ in
if let data = data, let str = String(data: data, encoding: .utf8) {
self.accessToken = str.matches(for: "\"access_token\": \"([^\"]{64})\"").first
Expand Down
2 changes: 1 addition & 1 deletion Ace Link/Services/PlaylistServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PlaylistServer: Service {

override func run() {
let cmdInContainer = "echo '\(stream.m3uData)' > acelink.m3u8;" +
"python -m SimpleHTTPServer \(AppConstants.Docker.proxyPort)"
"python3 -m http.server \(AppConstants.Docker.proxyPort)"
_ = Process.runCommand(
"docker", "exec", "--detach", "--workdir=/acelink", engine.containerID!,
"sh", "-c", cmdInContainer
Expand Down
70 changes: 27 additions & 43 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,36 @@
# syntax=docker/dockerfile:experimental
FROM ubuntu:bionic

# Install system packages
RUN set -ex && \
apt-get update && \
apt-get install -yq --no-install-recommends \
ca-certificates \
python2.7 \
libpython2.7 \
net-tools \
python-setuptools \
python-m2crypto \
python-apsw \
python-lxml \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/cache/*

# Install Ace Stream
# https://wiki.acestream.media/Download#Linux
RUN mkdir -p /opt/acestream && \
wget --no-verbose --output-document acestream.tgz "https://download.acestream.media/linux/acestream_3.1.49_ubuntu_18.04_x86_64.tar.gz" && \
echo "d2ed7bdc38f6a47c05da730f7f6f600d48385a7455d922a2688f7112202ee19e acestream.tgz" | sha256sum --check && \
tar --extract --gzip --directory /opt/acestream --file acestream.tgz && \
rm -rf acestream.tgz && \
/opt/acestream/start-engine --version

# Acestream 3.1.49 install is missing library files,
# but we can grab these from a previous release.
# http://oldforum.acestream.media/index.php?topic=12448.msg26872
RUN wget --no-verbose --output-document acestream.tgz "https://download.acestream.media/linux/acestream_3.1.16_ubuntu_16.04_x86_64.tar.gz" && \
echo "452bccb8ae8b5ff4497bbb796081dcf3fec2b699ba9ce704107556a3d6ad2ad7 acestream.tgz" | sha256sum --check && \
tar --extract --gzip --strip-components 1 --directory /tmp --file acestream.tgz && \
cp /tmp/lib/acestreamengine/py*.so /opt/acestream/lib/acestreamengine/ && \
cp /tmp/lib/*.so* /usr/lib/x86_64-linux-gnu/ && \
rm -rf tmp/* acestream.tgz
# syntax=docker/dockerfile:1
FROM --platform=linux/amd64 ubuntu:focal

ENV LC_ALL="C.UTF-8" \
LANG="C.UTF-8" \
DOWNLOAD_URL="https://download.acestream.media/linux/acestream_3.2.3_ubuntu_18.04_x86_64_py3.8.tar.gz" \
CHECKSUM="bf45376f1f28aaff7d9849ff991bf34a6b9a65542460a2344a8826126c33727d"

# Install system packages.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked\
--mount=type=cache,target=/var/lib/apt,sharing=locked\
--mount=type=tmpfs,target=/tmp\
set -ex;\
apt-get update;\
apt-get install -yq --no-install-recommends ca-certificates python3.8 libpython3.8 python3-pip wget;\
mkdir -p /opt/acestream;\
wget --no-verbose --output-document /opt/acestream/acestream.tgz $DOWNLOAD_URL;\
echo "$CHECKSUM /opt/acestream/acestream.tgz" | sha256sum --check;\
tar --extract --gzip --directory /opt/acestream --file /opt/acestream/acestream.tgz;\
rm /opt/acestream/acestream.tgz;\
python3 -m pip install -r /opt/acestream/requirements.txt;\
/opt/acestream/start-engine --version;

# Overwrite disfunctional Ace Stream web player with a working videojs player,
# Access at http://127.0.0.1:6878/webui/player/<acestream id>
COPY player.html /opt/acestream/data/webui/html/player.html

# Prep dir
RUN mkdir /acelink

COPY acestream.conf /opt/acestream/acestream.conf
ENTRYPOINT ["/opt/acestream/start-engine", "@/opt/acestream/acestream.conf"]

HEALTHCHECK CMD wget -q -t1 -O- 'http://127.0.0.1:6878/webui/api/service?method=get_version' | grep '"error": null'
# Prep dir serving m3u8 files.
RUN mkdir /acelink

EXPOSE 6878
EXPOSE 8621

ENTRYPOINT ["/opt/acestream/start-engine", "@/opt/acestream/acestream.conf"]
HEALTHCHECK CMD wget -q -t1 -O- 'http://127.0.0.1:6878/webui/api/service?method=get_version' | grep '"error": null'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Ace Link is a menu bar app that allows playing Ace Streams on macOS.

Play an Ace Stream or Magnet in any media player by pasting the URL in the Ace Link menu, or open an acestream or magnet link in Ace Link.

## [Download for macOS](https://github.com/blaise-io/acelink/releases/download/2.0.6/Ace.Link.2.0.6.dmg)
## [Download for macOS](https://github.com/blaise-io/acelink/releases/download/2.1.0/Ace.Link.2.1.0.dmg)

- Install using HomeBrew: `brew install --cask ace-link`
- [Download an older version](https://github.com/blaise-io/acelink/releases)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.6
2.1.0

0 comments on commit aee2cad

Please sign in to comment.