diff --git a/lnbits/extensions/livestream/README.md b/lnbits/extensions/livestream/README.md
deleted file mode 100644
index b2cf41d6..00000000
--- a/lnbits/extensions/livestream/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# DJ Livestream
-
-## Help DJ's and music producers conduct music livestreams
-
-LNbits Livestream extension produces a static QR code that can be shown on screen while livestreaming a DJ set for example. If someone listening to the livestream likes a song and want to support the DJ and/or the producer he can scan the QR code with a LNURL-pay capable wallet.
-
-When scanned, the QR code sends up information about the song playing at the moment (name and the producer of that song). Also, if the user likes the song and would like to support the producer, he can send a tip and a message for that specific track. If the user sends an amount over a specific threshold they will be given a link to download it (optional).
-
-The revenue will be sent to a wallet created specifically for that producer, with optional revenue splitting between the DJ and the producer.
-
-[**Wallets supporting LNURL**](https://github.com/fiatjaf/awesome-lnurl#wallets)
-
-[](https://youtu.be/zDrSWShKz7k 'video tutorial offline shop')
-
-## Usage
-
-1. Start by adding a track\
- 
- - set the producer, or choose an existing one
- - set the track name
- - define a minimum price where a user can download the track
- - set the download URL, where user will be redirected if he tips the livestream and the tip is equal or above the set price\
- 
-2. Adjust the percentage of the pay you want to take from the user's tips. 10%, the default, means that the DJ will keep 10% of all the tips sent by users. The other 90% will go to an auto generated producer wallet\
- 
-3. For every different producer added, when adding tracks, a wallet is generated for them\
- 
-4. On the bottom of the LNbits DJ Livestream extension you'll find the static QR code ([LNURL-pay](https://github.com/lnbits/lnbits/blob/master/lnbits/extensions/lnurlp/README.md)) you can add to the livestream or if you're a street performer you can print it and have it displayed
-5. After all tracks and producers are added, you can start "playing" songs\
- 
-6. You'll see the current track playing and a green icon indicating active track also\
- 
-7. When a user scans the QR code, and sends a tip, you'll receive 10%, in the example case, in your wallet and the producer's wallet will get the rest. For example someone tips 100 sats, you'll get 10 sats and the producer will get 90 sats
- - producer's wallet receiving 18 sats from 20 sats tips\
- 
-
-## Use cases
-
-You can print the QR code and display it on a live gig, a street performance, etc... OR you can use the QR as an overlay in an online stream of you playing music, doing a DJ set, making a podcast.
-
-You can use the extension's API to trigger updates for the current track, update fees, add tracks...
-
-## Sponsored by
-
-[](https://cryptograffiti.com/)
diff --git a/lnbits/extensions/livestream/__init__.py b/lnbits/extensions/livestream/__init__.py
deleted file mode 100644
index accd61de..00000000
--- a/lnbits/extensions/livestream/__init__.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import asyncio
-
-from fastapi import APIRouter
-from fastapi.staticfiles import StaticFiles
-
-from lnbits.db import Database
-from lnbits.helpers import template_renderer
-from lnbits.tasks import catch_everything_and_restart
-
-db = Database("ext_livestream")
-
-livestream_static_files = [
- {
- "path": "/livestream/static",
- "app": StaticFiles(packages=[("lnbits", "extensions/livestream/static")]),
- "name": "livestream_static",
- }
-]
-
-livestream_ext: APIRouter = APIRouter(prefix="/livestream", tags=["livestream"])
-
-
-def livestream_renderer():
- return template_renderer(["lnbits/extensions/livestream/templates"])
-
-
-from .lnurl import * # noqa: F401,F403
-from .tasks import wait_for_paid_invoices
-from .views import * # noqa: F401,F403
-from .views_api import * # noqa: F401,F403
-
-
-def livestream_start():
- loop = asyncio.get_event_loop()
- loop.create_task(catch_everything_and_restart(wait_for_paid_invoices))
diff --git a/lnbits/extensions/livestream/config.json b/lnbits/extensions/livestream/config.json
deleted file mode 100644
index d2674e70..00000000
--- a/lnbits/extensions/livestream/config.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "DJ Livestream",
- "short_description": "Sell tracks and split revenue (lnurl-pay)",
- "tile": "/livestream/static/image/livestream.png",
- "contributors": [
- "fiatjaf",
- "cryptograffiti"
- ],
- "hidden": false
-}
diff --git a/lnbits/extensions/livestream/crud.py b/lnbits/extensions/livestream/crud.py
deleted file mode 100644
index 037851aa..00000000
--- a/lnbits/extensions/livestream/crud.py
+++ /dev/null
@@ -1,203 +0,0 @@
-from typing import List, Optional
-
-from lnbits.core.crud import create_account, create_wallet
-from lnbits.db import SQLITE
-
-from . import db
-from .models import Livestream, Producer, Track
-
-
-async def create_livestream(*, wallet_id: str) -> int:
- returning = "" if db.type == SQLITE else "RETURNING ID"
- method = db.execute if db.type == SQLITE else db.fetchone
-
- result = await (method)(
- f"""
- INSERT INTO livestream.livestreams (wallet)
- VALUES (?)
- {returning}
- """,
- (wallet_id,),
- )
-
- if db.type == SQLITE:
- return result._result_proxy.lastrowid
- else:
- return result[0] # type: ignore
-
-
-async def get_livestream(ls_id: int) -> Optional[Livestream]:
- row = await db.fetchone(
- "SELECT * FROM livestream.livestreams WHERE id = ?", (ls_id,)
- )
- return Livestream(**row) if row else None
-
-
-async def get_livestream_by_track(track_id: int) -> Optional[Livestream]:
- row = await db.fetchone(
- """
- SELECT * FROM livestream.tracks WHERE tracks.id = ?
- """,
- (track_id,),
- )
- row2 = await db.fetchone(
- """
- SELECT * FROM livestream.livestreams WHERE livestreams.id = ?
- """,
- (row.livestream,),
- )
- return Livestream(**row2) if row2 else None
-
-
-async def get_or_create_livestream_by_wallet(wallet: str) -> Optional[Livestream]:
- row = await db.fetchone(
- "SELECT * FROM livestream.livestreams WHERE wallet = ?", (wallet,)
- )
-
- if not row:
- # create on the fly
- ls_id = await create_livestream(wallet_id=wallet)
- return await get_livestream(ls_id)
-
- return Livestream(**row) if row else None
-
-
-async def update_current_track(ls_id: int, track_id: Optional[int]):
- await db.execute(
- "UPDATE livestream.livestreams SET current_track = ? WHERE id = ?",
- (track_id, ls_id),
- )
-
-
-async def update_livestream_fee(ls_id: int, fee_pct: int):
- await db.execute(
- "UPDATE livestream.livestreams SET fee_pct = ? WHERE id = ?", (fee_pct, ls_id)
- )
-
-
-async def add_track(
- livestream: int,
- name: str,
- download_url: Optional[str],
- price_msat: int,
- producer: Optional[int],
-) -> int:
- result = await db.execute(
- """
- INSERT INTO livestream.tracks (livestream, name, download_url, price_msat, producer)
- VALUES (?, ?, ?, ?, ?)
- """,
- (livestream, name, download_url, price_msat, producer),
- )
- return result._result_proxy.lastrowid
-
-
-async def update_track(
- livestream: int,
- track_id: int,
- name: str,
- download_url: Optional[str],
- price_msat: int,
- producer: int,
-) -> int:
- result = await db.execute(
- """
- UPDATE livestream.tracks SET
- name = ?,
- download_url = ?,
- price_msat = ?,
- producer = ?
- WHERE livestream = ? AND id = ?
- """,
- (name, download_url, price_msat, producer, livestream, track_id),
- )
- return result._result_proxy.lastrowid
-
-
-async def get_track(track_id: Optional[int]) -> Optional[Track]:
- if not track_id:
- return None
-
- row = await db.fetchone(
- """
- SELECT id, download_url, price_msat, name, producer
- FROM livestream.tracks WHERE id = ?
- """,
- (track_id,),
- )
- return Track(**row) if row else None
-
-
-async def get_tracks(livestream: int) -> List[Track]:
- rows = await db.fetchall(
- """
- SELECT id, download_url, price_msat, name, producer
- FROM livestream.tracks WHERE livestream = ?
- """,
- (livestream,),
- )
- return [Track(**row) for row in rows]
-
-
-async def delete_track_from_livestream(livestream: int, track_id: int):
- await db.execute(
- """
- DELETE FROM livestream.tracks WHERE livestream = ? AND id = ?
- """,
- (livestream, track_id),
- )
-
-
-async def add_producer(livestream: int, name: str) -> int:
- name = name.strip()
-
- existing = await db.fetchall(
- """
- SELECT id FROM livestream.producers
- WHERE livestream = ? AND lower(name) = ?
- """,
- (livestream, name.lower()),
- )
- if existing:
- return existing[0].id
-
- user = await create_account()
- wallet = await create_wallet(user_id=user.id, wallet_name="livestream: " + name)
-
- returning = "" if db.type == SQLITE else "RETURNING ID"
- method = db.execute if db.type == SQLITE else db.fetchone
-
- result = await method(
- f"""
- INSERT INTO livestream.producers (livestream, name, "user", wallet)
- VALUES (?, ?, ?, ?)
- {returning}
- """,
- (livestream, name, user.id, wallet.id),
- )
- if db.type == SQLITE:
- return result._result_proxy.lastrowid
- else:
- return result[0] # type: ignore
-
-
-async def get_producer(producer_id: int) -> Optional[Producer]:
- row = await db.fetchone(
- """
- SELECT id, "user", wallet, name
- FROM livestream.producers WHERE id = ?
- """,
- (producer_id,),
- )
- return Producer(**row) if row else None
-
-
-async def get_producers(livestream: int) -> List[Producer]:
- rows = await db.fetchall(
- """
- SELECT id, "user", wallet, name
- FROM livestream.producers WHERE livestream = ?
- """,
- (livestream,),
- )
- return [Producer(**row) for row in rows]
diff --git a/lnbits/extensions/livestream/lnurl.py b/lnbits/extensions/livestream/lnurl.py
deleted file mode 100644
index e3e1b1be..00000000
--- a/lnbits/extensions/livestream/lnurl.py
+++ /dev/null
@@ -1,118 +0,0 @@
-import math
-from http import HTTPStatus
-
-from fastapi import HTTPException, Query, Request
-from lnurl import LnurlErrorResponse, LnurlPayActionResponse, LnurlPayResponse
-from lnurl.models import ClearnetUrl, LightningInvoice, MilliSatoshi
-
-from lnbits.core.services import create_invoice
-
-from . import livestream_ext
-from .crud import get_livestream, get_livestream_by_track, get_track
-
-
-@livestream_ext.get("/lnurl/{ls_id}", name="livestream.lnurl_livestream")
-async def lnurl_livestream(ls_id, request: Request):
- ls = await get_livestream(ls_id)
- if not ls:
- raise HTTPException(
- status_code=HTTPStatus.NOT_FOUND, detail="Livestream not found."
- )
-
- track = await get_track(ls.current_track)
- if not track:
- raise HTTPException(
- status_code=HTTPStatus.NOT_FOUND, detail="This livestream is offline."
- )
-
- resp = LnurlPayResponse(
- callback=ClearnetUrl(
- request.url_for("livestream.lnurl_callback", track_id=track.id),
- scheme="https",
- ),
- minSendable=MilliSatoshi(track.min_sendable),
- maxSendable=MilliSatoshi(track.max_sendable),
- metadata=await track.lnurlpay_metadata(),
- )
-
- params = resp.dict()
- params["commentAllowed"] = 300
-
- return params
-
-
-@livestream_ext.get("/lnurl/t/{track_id}", name="livestream.lnurl_track")
-async def lnurl_track(track_id, request: Request):
- track = await get_track(track_id)
- if not track:
- raise HTTPException(status_code=HTTPStatus.NOT_FOUND, detail="Track not found.")
-
- resp = LnurlPayResponse(
- callback=ClearnetUrl(
- request.url_for("livestream.lnurl_callback", track_id=track.id),
- scheme="https",
- ),
- minSendable=MilliSatoshi(track.min_sendable),
- maxSendable=MilliSatoshi(track.max_sendable),
- metadata=await track.lnurlpay_metadata(),
- )
-
- params = resp.dict()
- params["commentAllowed"] = 300
-
- return params
-
-
-@livestream_ext.get("/lnurl/cb/{track_id}", name="livestream.lnurl_callback")
-async def lnurl_callback(
- track_id, request: Request, amount: int = Query(...), comment: str = Query("")
-):
- track = await get_track(track_id)
- if not track:
- raise HTTPException(status_code=HTTPStatus.NOT_FOUND, detail="Track not found.")
-
- amount_received = int(amount or 0)
-
- if amount_received < track.min_sendable:
- return LnurlErrorResponse(
- reason=f"Amount {round(amount_received / 1000)} is smaller than minimum {math.floor(track.min_sendable)}."
- ).dict()
- elif track.max_sendable < amount_received:
- return LnurlErrorResponse(
- reason=f"Amount {round(amount_received / 1000)} is greater than maximum {math.floor(track.max_sendable)}."
- ).dict()
-
- if len(comment or "") > 300:
- return LnurlErrorResponse(
- reason=f"Got a comment with {len(comment)} characters, but can only accept 300"
- ).dict()
-
- ls = await get_livestream_by_track(track_id)
- assert ls
-
- extra_amount = amount_received - int(amount_received * (100 - ls.fee_pct) / 100)
-
- payment_hash, payment_request = await create_invoice(
- wallet_id=ls.wallet,
- amount=int(amount_received / 1000),
- memo=await track.fullname(),
- unhashed_description=(await track.lnurlpay_metadata()).encode(),
- extra={
- "tag": "livestream",
- "track": track.id,
- "comment": comment,
- "amount": int(extra_amount / 1000),
- },
- )
-
- assert track.price_msat
- if amount_received < track.price_msat:
- success_action = None
- else:
- success_action = track.success_action(payment_hash, request=request)
-
- resp = LnurlPayActionResponse(
- pr=LightningInvoice(payment_request), successAction=success_action, routes=[]
- )
-
- return resp.dict()
diff --git a/lnbits/extensions/livestream/migrations.py b/lnbits/extensions/livestream/migrations.py
deleted file mode 100644
index fb664ab1..00000000
--- a/lnbits/extensions/livestream/migrations.py
+++ /dev/null
@@ -1,39 +0,0 @@
-async def m001_initial(db):
- """
- Initial livestream tables.
- """
- await db.execute(
- f"""
- CREATE TABLE livestream.livestreams (
- id {db.serial_primary_key},
- wallet TEXT NOT NULL,
- fee_pct INTEGER NOT NULL DEFAULT 10,
- current_track INTEGER
- );
- """
- )
-
- await db.execute(
- f"""
- CREATE TABLE livestream.producers (
- livestream INTEGER NOT NULL REFERENCES {db.references_schema}livestreams (id),
- id {db.serial_primary_key},
- "user" TEXT NOT NULL,
- wallet TEXT NOT NULL,
- name TEXT NOT NULL
- );
- """
- )
-
- await db.execute(
- f"""
- CREATE TABLE livestream.tracks (
- livestream INTEGER NOT NULL REFERENCES {db.references_schema}livestreams (id),
- id {db.serial_primary_key},
- download_url TEXT,
- price_msat INTEGER NOT NULL DEFAULT 0,
- name TEXT,
- producer INTEGER REFERENCES {db.references_schema}producers (id) NOT NULL
- );
- """
- )
diff --git a/lnbits/extensions/livestream/models.py b/lnbits/extensions/livestream/models.py
deleted file mode 100644
index 31d3f6eb..00000000
--- a/lnbits/extensions/livestream/models.py
+++ /dev/null
@@ -1,103 +0,0 @@
-import json
-from sqlite3 import Row
-from typing import Optional
-
-from fastapi import Query, Request
-from lnurl import Lnurl
-from lnurl import encode as lnurl_encode
-from lnurl.models import ClearnetUrl, Max144Str, UrlAction
-from lnurl.types import LnurlPayMetadata
-from pydantic import BaseModel
-
-
-class CreateTrack(BaseModel):
- name: str = Query(...)
- download_url: str = Query(None)
- price_msat: int = Query(None, ge=0)
- producer_id: str = Query(None)
- producer_name: str = Query(None)
-
-
-class Livestream(BaseModel):
- id: int
- wallet: str
- fee_pct: int
- current_track: Optional[int]
-
- def lnurl(self, request: Request) -> Lnurl:
- url = request.url_for("livestream.lnurl_livestream", ls_id=self.id)
- return lnurl_encode(url)
-
- @classmethod
- def from_row(cls, row: Row):
- return cls(**dict(row))
-
-
-class Track(BaseModel):
- id: int
- download_url: Optional[str]
- price_msat: int = 0
- name: str
- producer: int
-
- @classmethod
- def from_row(cls, row: Row):
- return cls(**dict(row))
-
- @property
- def min_sendable(self) -> int:
- return min(100_000, self.price_msat or 100_000)
-
- @property
- def max_sendable(self) -> int:
- return max(50_000_000, self.price_msat * 5)
-
- def lnurl(self, request: Request) -> Lnurl:
- url = request.url_for("livestream.lnurl_track", track_id=self.id)
- return lnurl_encode(url)
-
- async def fullname(self) -> str:
- from .crud import get_producer
-
- producer = await get_producer(self.producer)
- if producer:
- producer_name = producer.name
- else:
- producer_name = "unknown author"
-
- return f"'{self.name}', from {producer_name}."
-
- async def lnurlpay_metadata(self) -> LnurlPayMetadata:
- description = (
- await self.fullname()
- ) + " Like this track? Send some sats in appreciation."
-
- if self.download_url:
- description += f" Send {round(self.price_msat/1000)} sats or more and you can download it."
-
- return LnurlPayMetadata(json.dumps([["text/plain", description]]))
-
- def success_action(
- self, payment_hash: str, request: Request
- ) -> Optional[UrlAction]:
- if not self.download_url:
- return None
-
- url = request.url_for("livestream.track_redirect_download", track_id=self.id)
- url_with_query = f"{url}?p={payment_hash}"
-
- return UrlAction(
- url=ClearnetUrl(url_with_query, scheme="https"),
- description=Max144Str(f"Download the track {self.name}!"),
- )
-
-
-class Producer(BaseModel):
- id: int
- user: str
- wallet: str
- name: str
-
- @classmethod
- def from_row(cls, row: Row):
- return cls(**dict(row))
diff --git a/lnbits/extensions/livestream/static/image/livestream.png b/lnbits/extensions/livestream/static/image/livestream.png
deleted file mode 100644
index 7d53d566..00000000
Binary files a/lnbits/extensions/livestream/static/image/livestream.png and /dev/null differ
diff --git a/lnbits/extensions/livestream/static/js/index.js b/lnbits/extensions/livestream/static/js/index.js
deleted file mode 100644
index c49befce..00000000
--- a/lnbits/extensions/livestream/static/js/index.js
+++ /dev/null
@@ -1,216 +0,0 @@
-/* globals Quasar, Vue, _, VueQrcode, windowMixin, LNbits, LOCALE */
-
-Vue.component(VueQrcode.name, VueQrcode)
-
-new Vue({
- el: '#vue',
- mixins: [windowMixin],
- data() {
- return {
- cancelListener: () => {},
- selectedWallet: null,
- nextCurrentTrack: null,
- livestream: {
- tracks: [],
- producers: []
- },
- trackDialog: {
- show: false,
- data: {}
- }
- }
- },
- computed: {
- sortedTracks() {
- return this.livestream.tracks.sort((a, b) => a.name - b.name)
- },
- tracksMap() {
- return Object.fromEntries(
- this.livestream.tracks.map(track => [track.id, track])
- )
- },
- producersMap() {
- return Object.fromEntries(
- this.livestream.producers.map(prod => [prod.id, prod])
- )
- }
- },
- methods: {
- getTrackLabel(trackId) {
- if (!trackId) return
- let track = this.tracksMap[trackId]
- return `${track.name}, ${this.producersMap[track.producer].name}`
- },
- disabledAddTrackButton() {
- return (
- !this.trackDialog.data.name ||
- this.trackDialog.data.name.length === 0 ||
- !this.trackDialog.data.producer ||
- this.trackDialog.data.producer.length === 0
- )
- },
- changedWallet(wallet) {
- this.selectedWallet = wallet
- this.loadLivestream()
- this.startPaymentNotifier()
- },
- loadLivestream() {
- LNbits.api
- .request(
- 'GET',
- '/livestream/api/v1/livestream',
- this.selectedWallet.inkey
- )
- .then(response => {
- this.livestream = response.data
- this.nextCurrentTrack = this.livestream.current_track
- })
- .catch(err => {
- LNbits.utils.notifyApiError(err)
- })
- },
- startPaymentNotifier() {
- this.cancelListener()
-
- this.cancelListener = LNbits.events.onInvoicePaid(
- this.selectedWallet,
- payment => {
- let satoshiAmount = Math.round(payment.amount / 1000)
- let trackName = (
- this.tracksMap[payment.extra.track] || {name: '[unknown]'}
- ).name
-
- this.$q.notify({
- message: `Someone paid ${satoshiAmount} sat for the track ${trackName}.`,
- caption: payment.extra.comment
- ? `"${payment.extra.comment}"`
- : undefined,
- color: 'secondary',
- html: true,
- timeout: 0,
- actions: [{label: 'Dismiss', color: 'white', handler: () => {}}]
- })
- }
- )
- },
- addTrack() {
- let {id, name, producer, price_sat, download_url} = this.trackDialog.data
-
- const [method, path] = id
- ? ['PUT', `/livestream/api/v1/livestream/tracks/${id}`]
- : ['POST', '/livestream/api/v1/livestream/tracks']
-
- LNbits.api
- .request(method, path, this.selectedWallet.inkey, {
- download_url:
- download_url && download_url.length > 0 ? download_url : undefined,
- name,
- price_msat: price_sat * 1000 || 0,
- producer_name: typeof producer === 'string' ? producer : undefined,
- producer_id: typeof producer === 'object' ? producer.id : undefined
- })
- .then(response => {
- this.$q.notify({
- message: `Track '${this.trackDialog.data.name}' added.`,
- timeout: 700
- })
- this.loadLivestream()
- this.trackDialog.show = false
- this.trackDialog.data = {}
- })
- .catch(err => {
- LNbits.utils.notifyApiError(err)
- })
- },
- openAddTrackDialog() {
- this.trackDialog.show = true
- this.trackDialog.data = {}
- },
- openUpdateDialog(itemId) {
- this.trackDialog.show = true
- let item = this.livestream.tracks.find(item => item.id === itemId)
- this.trackDialog.data = {
- ...item,
- producer: this.livestream.producers.find(
- prod => prod.id === item.producer
- ),
- price_sat: Math.round(item.price_msat / 1000)
- }
- },
- deleteTrack(trackId) {
- LNbits.utils
- .confirmDialog('Are you sure you want to delete this track?')
- .onOk(() => {
- LNbits.api
- .request(
- 'DELETE',
- '/livestream/api/v1/livestream/tracks/' + trackId,
- this.selectedWallet.inkey
- )
- .then(response => {
- this.$q.notify({
- message: `Track deleted`,
- timeout: 700
- })
- this.livestream.tracks.splice(
- this.livestream.tracks.findIndex(track => track.id === trackId),
- 1
- )
- })
- .catch(err => {
- LNbits.utils.notifyApiError(err)
- })
- })
- },
- updateCurrentTrack(track) {
- console.log(this.nextCurrentTrack, this.livestream)
- if (this.livestream.current_track === track) {
- // if clicking the same, stop it
- track = 0
- }
-
- LNbits.api
- .request(
- 'PUT',
- '/livestream/api/v1/livestream/track/' + track,
- this.selectedWallet.inkey
- )
- .then(() => {
- this.livestream.current_track = track
- this.nextCurrentTrack = track
- this.$q.notify({
- message: `Current track updated.`,
- timeout: 700
- })
- })
- .catch(err => {
- LNbits.utils.notifyApiError(err)
- })
- },
- updateFeePct() {
- LNbits.api
- .request(
- 'PUT',
- '/livestream/api/v1/livestream/fee/' + this.livestream.fee_pct,
- this.selectedWallet.inkey
- )
- .then(() => {
- this.$q.notify({
- message: `Percentage updated.`,
- timeout: 700
- })
- })
- .catch(err => {
- LNbits.utils.notifyApiError(err)
- })
- },
- producerAdded(added, cb) {
- cb(added)
- }
- },
- created() {
- this.selectedWallet = this.g.user.wallets[0]
- this.loadLivestream()
- this.startPaymentNotifier()
- }
-})
diff --git a/lnbits/extensions/livestream/tasks.py b/lnbits/extensions/livestream/tasks.py
deleted file mode 100644
index 4489dad9..00000000
--- a/lnbits/extensions/livestream/tasks.py
+++ /dev/null
@@ -1,70 +0,0 @@
-import asyncio
-
-from loguru import logger
-
-from lnbits.core.models import Payment
-from lnbits.core.services import create_invoice, pay_invoice
-from lnbits.helpers import get_current_extension_name
-from lnbits.tasks import register_invoice_listener
-
-from .crud import get_livestream_by_track, get_producer, get_track
-
-
-async def wait_for_paid_invoices():
- invoice_queue = asyncio.Queue()
- register_invoice_listener(invoice_queue, get_current_extension_name())
-
- while True:
- payment = await invoice_queue.get()
- await on_invoice_paid(payment)
-
-
-async def on_invoice_paid(payment: Payment) -> None:
-
- if payment.extra.get("tag") != "livestream":
- # not a livestream invoice
- return
-
- track = await get_track(payment.extra.get("track", -1))
- if not track:
- logger.error("this should never happen", payment)
- return
-
- if payment.extra.get("shared_with"):
- logger.error("payment was shared already", payment)
- return
-
- producer = await get_producer(track.producer)
- assert producer, f"track {track.id} is not associated with a producer"
-
- ls = await get_livestream_by_track(track.id)
- assert ls, f"track {track.id} is not associated with a livestream"
-
- amount = int(payment.amount * (100 - ls.fee_pct) / 100)
-
- payment_hash, payment_request = await create_invoice(
- wallet_id=producer.wallet,
- amount=int(amount / 1000),
- internal=True,
- memo=f"Revenue from '{track.name}'.",
- )
- logger.debug(
- f"livestream: producer invoice created: {payment_hash}, {amount} msats"
- )
-
- checking_id = await pay_invoice(
- payment_request=payment_request,
- wallet_id=payment.wallet_id,
- extra={
- **payment.extra,
- "shared_with": f"Producer ID: {producer.id}",
- "received": payment.amount,
- },
- )
- logger.debug(f"livestream: producer invoice paid: {checking_id}")
-
- # so the flow is the following:
- # - we receive, say, 1000 satoshis
- # - if the fee_pct is, say, 30%, the amount we will send is 700
- # - we change the amount of receiving payment on the database from 1000 to 300
- # - we create a new payment on the producer's wallet with amount 700
diff --git a/lnbits/extensions/livestream/templates/livestream/_api_docs.html b/lnbits/extensions/livestream/templates/livestream/_api_docs.html
deleted file mode 100644
index 34b6518d..00000000
--- a/lnbits/extensions/livestream/templates/livestream/_api_docs.html
+++ /dev/null
@@ -1,150 +0,0 @@
- Add tracks, profit.GET
- /livestream/api/v1/livestream
- Headers
- {"X-Api-Key": <invoice_key>}
- Body (application/json)
-
- Returns 200 OK (application/json)
-
- [<livestream_object>, ...]
- Curl example
- curl -X GET {{ request.base_url }}livestream/api/v1/livestream -H
- "X-Api-Key: {{ user.wallets[0].inkey }}"
-
- PUT
- /livestream/api/v1/livestream/track/<track_id>
- Headers
- {"X-Api-Key": <invoice_key>}
- Body (application/json)
-
- Returns 201 CREATED (application/json)
-
- Curl example
- curl -X PUT {{ request.base_url }}
- livestream/api/v1/livestream/track/<track_id> -H "X-Api-Key: {{
- user.wallets[0].inkey }}"
-
- PUT
- /livestream/api/v1/livestream/fee/<fee_pct>
- Headers
- {"X-Api-Key": <invoice_key>}
- Body (application/json)
-
- Returns 201 CREATED (application/json)
-
- Curl example
- curl -X PUT {{ request.base_url }}
- livestream/api/v1/livestream/fee/<fee_pct> -H "X-Api-Key: {{
- user.wallets[0].inkey }}"
-
- POST
- /livestream/api/v1/livestream/tracks
- Headers
- {"X-Api-Key": <invoice_key>}
- Body (application/json)
- {"name": <string>, "download_url": <string>,
- "price_msat": <integer>, "producer_id": <integer>,
- "producer_name": <string>}
-
- Returns 201 CREATED (application/json)
-
- Curl example
- curl -X POST {{ request.base_url }}
- livestream/api/v1/livestream/tracks -d '{"name": <string>,
- "download_url": <string>, "price_msat": <integer>,
- "producer_id": <integer>, "producer_name": <string>}' -H
- "Content-type: application/json" -H "X-Api-Key: {{
- user.wallets[0].adminkey }}"
-
- DELETE
- /livestream/api/v1/livestream/tracks/<track_id>
- Headers
- {"X-Api-Key": <invoice_key>}
- Returns 204 NO CONTENT
-
- Curl example
- curl -X DELETE {{ request.base_url }}
- livestream/api/v1/livestream/tracks/<track_id> -H "X-Api-Key: {{
- user.wallets[0].inkey }}"
-
-
- Standalone QR Code for this track -
- -