Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: andrew-ld/smart-tv-telegram
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.1.1-dev1
Choose a base ref
...
head repository: andrew-ld/smart-tv-telegram
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Nov 3, 2020

  1. Copy the full SHA
    b1f38cc View commit details
  2. Create setuptools.yml

    andrew-ld authored Nov 3, 2020
    Copy the full SHA
    f41cf20 View commit details
  3. try enable python 3.9

    andrew-ld authored Nov 3, 2020
    Copy the full SHA
    7f3243c View commit details

Commits on Nov 5, 2020

  1. add unittest

    andrew (from workstation) committed Nov 5, 2020
    Copy the full SHA
    b3b98bf View commit details
  2. unittest in ci

    andrew (from workstation) committed Nov 5, 2020
    Copy the full SHA
    ad11b33 View commit details
  3. Copy the full SHA
    afca627 View commit details

Commits on Nov 6, 2020

  1. add pylint workflow

    andrew (from workstation) committed Nov 6, 2020
    Copy the full SHA
    3371c6b View commit details
  2. install requirements.txt on pylint workflow

    andrew (from workstation) committed Nov 6, 2020
    Copy the full SHA
    4089066 View commit details

Commits on Nov 9, 2020

  1. print device play exc

    andrew (from workstation) committed Nov 9, 2020
    Copy the full SHA
    4fb0b1f View commit details

Commits on Nov 10, 2020

  1. always cast filename to string

    andrew (from workstation) committed Nov 10, 2020
    Copy the full SHA
    70c090d View commit details

Commits on Nov 11, 2020

  1. apply flake8 suggestions

    andrew (from workstation) committed Nov 11, 2020
    Copy the full SHA
    5271874 View commit details
  2. fix typo in workflow

    andrew (from workstation) committed Nov 11, 2020
    Copy the full SHA
    af069fd View commit details

Commits on Dec 1, 2020

  1. Update README.md

    andrew-ld authored Dec 1, 2020
    Copy the full SHA
    4c415f7 View commit details

Commits on Dec 5, 2020

  1. handle badserversalt .,.,.,,.

    andrew (from workstation) committed Dec 5, 2020
    Copy the full SHA
    bc2e56a View commit details
  2. apply flake/pylint suggestion

    andrew (from workstation) committed Dec 5, 2020
    Copy the full SHA
    90bc276 View commit details

Commits on Dec 8, 2020

  1. initial web api structure

    andrew (from workstation) committed Dec 8, 2020
    Copy the full SHA
    f3f57bb View commit details
  2. cleanup

    andrew (from workstation) committed Dec 8, 2020
    Copy the full SHA
    8fd2ecb View commit details
  3. camel case typdef

    andrew (from workstation) committed Dec 8, 2020
    Copy the full SHA
    2934f57 View commit details
  4. web play api

    andrew (from workstation) committed Dec 8, 2020
    Copy the full SHA
    c39c963 View commit details
  5. increment plugin method

    andrew (from workstation) committed Dec 8, 2020
    Copy the full SHA
    b2cedb8 View commit details
  6. webui

    andrew (from workstation) committed Dec 8, 2020
    Copy the full SHA
    f41dc2b View commit details

Commits on Dec 25, 2020

  1. async timeout finder

    andrew (from workstation) committed Dec 25, 2020
    Copy the full SHA
    a235c32 View commit details
  2. bump deps

    andrew (from workstation) committed Dec 25, 2020
    Copy the full SHA
    96a8374 View commit details
  3. bump version

    andrew (from workstation) committed Dec 25, 2020
    Copy the full SHA
    5ac2dae View commit details
  4. set wheel as setup requires

    andrew (from workstation) committed Dec 25, 2020
    Copy the full SHA
    48709dc View commit details

Commits on Dec 28, 2020

  1. use pyrogram utils for get peer id from raw and bump version for hotfix

    andrew (from workstation) committed Dec 28, 2020
    Copy the full SHA
    d19c2e3 View commit details

Commits on Jan 1, 2021

  1. device buttons

    andrew (from workstation) committed Jan 1, 2021
    Copy the full SHA
    a1c5119 View commit details
  2. fix pylint

    andrew (from workstation) committed Jan 1, 2021
    Copy the full SHA
    2f24008 View commit details
  3. remove unittests because not have time for test all functions

    andrew (from workstation) committed Jan 1, 2021
    Copy the full SHA
    0a9a454 View commit details

Commits on Feb 26, 2021

  1. Bump aiohttp from 3.7.3 to 3.7.4

    Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.7.3 to 3.7.4.
    - [Release notes](https://github.com/aio-libs/aiohttp/releases)
    - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
    - [Commits](aio-libs/aiohttp@v3.7.3...v3.7.4)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Feb 26, 2021
    Copy the full SHA
    1e031c8 View commit details

Commits on Mar 10, 2021

  1. Merge pull request #12 from andrew-ld/dependabot/pip/aiohttp-3.7.4

    Bump aiohttp from 3.7.3 to 3.7.4
    andrew-ld authored Mar 10, 2021
    Copy the full SHA
    04356ee View commit details

Commits on Mar 17, 2021

  1. Copy the full SHA
    f869dd3 View commit details

Commits on Mar 18, 2021

  1. fix chromecast using async

    andrew-ld committed Mar 18, 2021
    Copy the full SHA
    ea6b255 View commit details
  2. remove blank line

    andrew-ld committed Mar 18, 2021
    Copy the full SHA
    98a5323 View commit details
  3. Copy the full SHA
    a924618 View commit details
  4. Fix typo in ghcr username

    MarcoBuster committed Mar 18, 2021
    Copy the full SHA
    1985bd6 View commit details
  5. Fix things

    MarcoBuster committed Mar 18, 2021
    Copy the full SHA
    fbfa81a View commit details
  6. Merge pull request #14 from MarcoBuster/master

    Docker multi-arch build and push workflow
    andrew-ld authored Mar 18, 2021
    Copy the full SHA
    88a6ce2 View commit details
  7. Copy the full SHA
    e554b1a View commit details
  8. Copy the full SHA
    d924cf4 View commit details

Commits on Mar 19, 2021

  1. Bump urllib3 from 1.26.2 to 1.26.3

    Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.2 to 1.26.3.
    - [Release notes](https://github.com/urllib3/urllib3/releases)
    - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
    - [Commits](urllib3/urllib3@1.26.2...1.26.3)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 19, 2021
    Copy the full SHA
    d6ac6b3 View commit details
  2. Merge pull request #15 from andrew-ld/dependabot/pip/urllib3-1.26.3

    Bump urllib3 from 1.26.2 to 1.26.3
    andrew-ld authored Mar 19, 2021
    Copy the full SHA
    7a84581 View commit details

Commits on Mar 21, 2021

  1. Copy the full SHA
    dd071c8 View commit details
  2. fix merge conflict

    andrew-ld committed Mar 21, 2021
    Copy the full SHA
    6114a8c View commit details

Commits on Mar 23, 2021

  1. generic entrypoint

    andrew-ld committed Mar 23, 2021
    Copy the full SHA
    2bbca28 View commit details

Commits on Mar 25, 2021

  1. chromecast player functions

    andrew-ld committed Mar 25, 2021
    Copy the full SHA
    64de489 View commit details
  2. Copy the full SHA
    8842752 View commit details

Commits on Mar 27, 2021

  1. upnp autoreconnect

    andrew-ld committed Mar 27, 2021
    Copy the full SHA
    cd92c49 View commit details
  2. Copy the full SHA
    e168450 View commit details

Commits on Apr 20, 2021

  1. Copy the full SHA
    e62be82 View commit details
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length=140
68 changes: 68 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
# ******** NOTE ********

name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '42 8 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
46 changes: 46 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker multi-arch build and push

on: [push, release]

jobs:
build:
name: Build Docker image (linux/386, linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64, linux/ppc64le)
runs-on: ubuntu-latest
env:
DH_IMAGE_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/smart-tv-telegram

steps:
- name: Checkout current repo
uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: |
${{ env.DH_IMAGE_TAG }}
tag-sha: true

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/386, linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64, linux/ppc64le
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
25 changes: 25 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "flake8"

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements.txt
- name: Analysing the code with flake8
run: |
flake8 smart_tv_telegram/
shell: bash
25 changes: 25 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "pylint"

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt
- name: Analysing the code with pylint
run: |
pylint $(find smart_tv_telegram/ -name "*.py" -type f | grep -v "test_" | xargs -n1)
shell: bash
29 changes: 29 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

run: |
python setup.py sdist bdist_wheel
twine upload dist/*
31 changes: 31 additions & 0 deletions .github/workflows/setuptools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "setuptools"

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9]

steps:
- name: Initialize pythom
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Checkout repository
uses: actions/checkout@v2

- name: build and install wheel package
run: |
pip install wheel
python setup.py sdist bdist_wheel
find dist -name "*.whl" -type f -exec pip install {} \;
shell: bash
18 changes: 18 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[FORMAT]
expected-line-ending-format=LF
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
indent-after-paren=4
indent-string=' '
max-line-length=120

[DESIGN]
max-attributes=30
min-public-methods=0
max-locals=30
max-statements=100
max-branches=100
max-returns=15
max-public-methods=25

[MESSAGES CONTROL]
disable=missing-function-docstring,missing-module-docstring,invalid-overridden-method,cyclic-import,missing-class-docstring,super-init-not-called,broad-except,protected-access,duplicate-code,consider-using-with
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3
FROM python:3.10

ENV PYTHONUNBUFFERED=1

@@ -14,8 +14,6 @@ WORKDIR /app

RUN rm -rf /tmp/setup

COPY healthcheck.py /

HEALTHCHECK CMD ["/healthcheck.py", "/app/config.ini"]
HEALTHCHECK CMD ["smart_tv_telegram", "--healthcheck"]

CMD ["smart_tv_telegram"]
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include smart_tv_telegram/static/*
42 changes: 34 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# smart-tv-telegram [![PyPI](https://img.shields.io/pypi/v/smart-tv-telegram)](https://pypi.org/project/smart-tv-telegram/) [![PyPI - License](https://img.shields.io/pypi/l/smart-tv-telegram)](https://github.com/andrew-ld/smart-tv-telegram/blob/master/LICENSE) [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/andrewhyphenld/smart-tv-telegram)](https://hub.docker.com/r/andrewhyphenld/smart-tv-telegram)
# smart-tv-telegram [![PyPI](https://img.shields.io/pypi/v/smart-tv-telegram)](https://pypi.org/project/smart-tv-telegram/) [![PyPI - License](https://img.shields.io/pypi/l/smart-tv-telegram)](https://github.com/andrew-ld/smart-tv-telegram/blob/master/LICENSE) [Docker](https://hub.docker.com/r/andrewhyphenld/smart-tv-telegram)
A Telegram Bot to stream content on your smart TV (also Chromecast, FireTV and other UPnP device)

### Demonstration video
@@ -8,27 +8,44 @@ A Telegram Bot to stream content on your smart TV (also Chromecast, FireTV and o
## Feature
- Streaming, the bot will not have to download the entire file before playing it on your device
- You can play anything if your device has the right codec
- You can streaming on any device that supports UPnP (AVTransport)
- You can stream on any device that supports UPnP (AVTransport)
- Chromecast, Vlc (telnet api) and Kodi (xbmc http api) support
- Streaming over HTTP
- Web interface that plays videos in your browser

Note: Chromecast (1st, 2nd and 3rd Gen.) [only supports H.264 and VP8 video codecs](https://developers.google.com/cast/docs/media#video_codecs)

Note: Most LG TVs with WebOS have an incorrect UPnP implementation, throw it in the trash and buy a new TV
Note: Most LG TVs with WebOS have an incorrect UPnP implementation

## How-to setup
## How-to setup (Release from pypi)
Make sure you have an updated version of python, only the latest version will be supported

(currently it also works on Python 3.6)
- Install smart-tv-telegram from pip
- Download config.ini.example as config.ini
- Edit config.ini
- Start from python entrypoint

```bash
python3 -m pip install --upgrade smart-tv-telegram
curl https://raw.githubusercontent.com/andrew-ld/smart-tv-telegram/master/config.ini.example -o config.ini
nano config.ini
smart_tv_telegram -c config.ini -v 1
```

## How-to setup (Manual build)
Make sure you have an updated version of python, only the latest version will be supported

- Download the repository
- Install python dependencies from requirements.txt
- Build wheel package
- Install package
- Copy config.ini.example to config.ini
- Edit config.ini
- Start from python entrypoint

```bash
git clone https://github.com/andrew-ld/smart-tv-telegram
cd smart-tv-telegram
python3 -m pip install wheel
python3 setup.py sdist bdist_wheel
python3 -m pip install dist/*.whl
cp config.ini.example config.ini
@@ -39,8 +56,8 @@ smart_tv_telegram -c config.ini -v 1
## How-to setup (Docker)
- Copy config.ini.example to config.ini
- Edit config.ini
- Build Docker
- Start Docker
- Build Docker image
- Start Docker container

```bash
cp config.ini.example config.ini
@@ -51,6 +68,15 @@ docker run --network host -v "$(pwd)/config.ini:/app/config.ini:ro" -d smart-tv-

## Troubleshooting

**Q:** How do I use the web interface?

**A:** Set `enabled` to `1` in `web_ui` config block, and change the `password`

- open http://`listen_ip`:`listen_port`/static/index.html

- now if you send a video in the bot on telegram you can choose to play it in the browser

##
**Q:** My Firewall block upnp and broadcasting, how can use kodi without it

**A:** Set `xbmc_enabled` to `1` and add your kodi device to `xbmc_devices` list
29 changes: 17 additions & 12 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Security Policy
# Reporting Security Issues
If you believe you have found a security vulnerability, please report it to us through coordinated disclosure.

## Supported Versions
Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.

| Version | Supported |
| ------- | ------------------ |
| latest commit | :white_check_mark: |
| any other version | :x: |
Instead, please send an email to andrew-ld@protonmail.com

## Well-known bugs
- we know the files are being transmitted via http, we're highly screwed since the tvs don't support https.
- there is no token to request the files: and after so much they can do mitm (read the point above)
- docker only goes if I use the host network, tell the pychromecast people how to do it without it, and I do it.
Please include as much of the information listed below as you can to help us better understand and resolve the issue:

## How to contact me
on github somewhere you can click to contact me, but I don't give money anyway so don't bust my balls.
The type of issue
Full paths of source file(s) related to the manifestation of the issue
The location of the affected source code (tag/branch/commit or direct URL)
Any special configuration required to reproduce the issue
Step-by-step instructions to reproduce the issue
Proof-of-concept or exploit code (if possible)
Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

# Well-known weakness
- Media are transmitted via http by design, as many devices lack support for https
Loading