all repos — FixYouTube-legacy @ d0969d3a3bc3c7ae41ee5c0636aaa7b5255736c0

A better way to embed YouTube videos everywhere (inspired by FixTweet).

change module name
Marco Andronaco andronacomarco@gmail.com
Sat, 26 Aug 2023 11:28:27 +0200
commit

d0969d3a3bc3c7ae41ee5c0636aaa7b5255736c0

parent

556aabf6284d0dc94693887934a3c04a3353c1ce

M .vscode/launch.json.vscode/launch.json

@@ -10,7 +10,7 @@ "type": "python",

"request": "launch", "module": "flask", "env": { - "FLASK_APP": "fxyoutube", + "FLASK_APP": "fixyoutube", "FLASK_DEBUG": "1" }, "args": [
M DockerfileDockerfile

@@ -6,5 +6,5 @@ RUN pip install --upgrade pip

COPY ./requirements.txt . RUN pip install -r requirements.txt -COPY ./fxyoutube ./fxyoutube -ENV APP_MODULE=fxyoutube:app +COPY ./fixyoutube ./fixyoutube +ENV APP_MODULE=fixyoutube:app
M README.mdREADME.md

@@ -1,5 +1,5 @@

# FixYouTube -Embed YouTube videos on Telegram! +Embed YouTube videos on Telegram, Discord and more! ## Docker ```

@@ -9,11 +9,11 @@

### Debug ``` poetry install -poetry run flask --app fxyoutube run --port 1111 --debug +poetry run flask --app fixyoutube run --port 1111 --debug ``` ### Production ``` poetry install --with prod -poetry run waitress-serve --port 1111 fxyoutube:app +poetry run waitress-serve --port 1111 fixyoutube:app ```
M fxyoutube/__init__.pyfixyoutube/__init__.py

@@ -2,4 +2,4 @@ from flask import Flask

app = Flask(__name__) -import fxyoutube.views +import fixyoutube.views
M fxyoutube/__main__.pyfixyoutube/__main__.py

@@ -1,4 +1,4 @@

from waitress import serve -from fxyoutube import app +from fixyoutube import app serve(app, listen='*:1111')
M fxyoutube/db.pyfixyoutube/db.py

@@ -1,8 +1,8 @@

from peewee import Model, CharField, TextField, IntegerField, DateTimeField, DoesNotExist from playhouse.sqliteq import SqliteQueueDatabase from datetime import datetime, timedelta -from fxyoutube.yt_info import get_info_ytdl -import fxyoutube.constants as c +from fixyoutube.yt_info import get_info_ytdl +import fixyoutube.constants as c db = SqliteQueueDatabase(c.DB_URL)
M fxyoutube/views.pyfixyoutube/views.py

@@ -1,6 +1,6 @@

-from fxyoutube import app -from fxyoutube.db import get_video_from_cache, get_info, clear_cache -import fxyoutube.constants as c +from fixyoutube import app +from fixyoutube.db import get_video_from_cache, get_info, clear_cache +import fixyoutube.constants as c from flask import request, redirect, abort, render_template, Response from requests import get
M fxyoutube/yt_info.pyfixyoutube/yt_info.py

@@ -1,5 +1,5 @@

from yt_dlp import YoutubeDL, DownloadError -import fxyoutube.constants as c +import fixyoutube.constants as c def truncate_lines(input_str: str, max: int = 4): return "\n".join(input_str.splitlines()[:max])
M pyproject.tomlpyproject.toml

@@ -1,9 +1,10 @@

[tool.poetry] -name = "fxyoutube" +name = "fixyoutube" version = "0.1.0" -description = "Embed YouTube videos on Telegram!" +description = "Embed YouTube videos on Telegram, Discord and more!" authors = ["Marco Andronaco <birabittoh@duck.com>"] readme = "README.md" +packages = [{include = "fixyoutube"}] [tool.poetry.dependencies] python = "^3.11"