Giter Site home page Giter Site logo

weebzone / surf-tg Goto Github PK

View Code? Open in Web Editor NEW
94.0 94.0 171.0 109 KB

Python Web App which Indexes a Your Telegram Channel and Serves its Files for Download and Stream.

License: GNU General Public License v3.0

Dockerfile 0.15% Python 56.18% HTML 43.61% Shell 0.03% Procfile 0.02%
bot index pyrogram telegram-bot telegram-index

surf-tg's Introduction

MasterHead

Hi ๐Ÿ‘‹, I'm Karan

A noob developer from India

Coding

weebzone

๐Ÿ’ซ About Me:

๐Ÿ”ญ Iโ€™m currently working on WZML

๐ŸŒฑ Iโ€™m currently learning Python

๐Ÿ“ซ How to reach me @_krn_adhikari

โšก Fun fact I am still an Ultra Noob Coder

๐ŸŒ Socials:

Instagram

๐Ÿ’ป Tech Stack:

C++ Markdown Python AWS Heroku MongoDB Postgres Adobe Lightroom Adobe Photoshop Gimp Gnu Image Manipulation Program

๐Ÿ“Š GitHub Stats:



๐Ÿ† GitHub Trophies


surf-tg's People

Contributors

silentdemonsd avatar weebzone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

surf-tg's Issues

Add features

ADD THIS FEATURES

  1. Make to Index Specific things like image, video, audio, text. (Like if someone just want to index video only from auth channel where img, video, audio and text are in same Channel.)

  2. Make this option also

{
"index_all": true,
"index_private": false,
"index_group": false,
"index_channel": true,
"exclude_chats": [id],
"include_chats": [id]
}

  1. Make a seperate option to send that file to Telegram from web app on click on Button for Downloading.

  2. Use artplayer instead of plyr.io

  3. Add functionality to index private Channels and Groups.

  4. Add a search box functionality for searching in all available sources. With live results.

  5. Make a function to block download using variable. So user can only stream online.

  6. Add on the go (otg) indexing for users. So they can index Channel manually also.

Make like this See this.
https://webcoderhub.blogspot.com/p/watchoflix.html

400 BOT_METHOD_INVALID

Telegram says: [400 BOT_METHOD_INVALID] - The method can't be used by bots (caused by "messages.GetHistory")

whats the solution to this

2024-05-08T09:52:29.483479+00:00 app[web.1]: Traceback (most recent call last):
2024-05-08T09:52:29.483481+00:00 app[web.1]: File "", line 198, in _run_module_as_main
2024-05-08T09:52:29.483492+00:00 app[web.1]: File "", line 88, in _run_code
2024-05-08T09:52:29.483492+00:00 app[web.1]: File "/app/bot/main.py", line 54, in
2024-05-08T09:52:29.483633+00:00 app[web.1]: loop.run_until_complete(stop_clients())
2024-05-08T09:52:29.483662+00:00 app[web.1]: File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
2024-05-08T09:52:29.483750+00:00 app[web.1]: File "/app/bot/main.py", line 44, in stop_clients
2024-05-08T09:52:29.483816+00:00 app[web.1]: await gather(StreamBot.stop(), UserBot.stop())
2024-05-08T09:52:29.483842+00:00 app[web.1]: File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/utilities/stop.py", line 66, in stop
2024-05-08T09:52:29.483981+00:00 app[web.1]: await do_it()
2024-05-08T09:52:29.483990+00:00 app[web.1]: File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/utilities/stop.py", line 62, in do_it
2024-05-08T09:52:29.484068+00:00 app[web.1]: await self.terminate()
2024-05-08T09:52:29.484071+00:00 app[web.1]: File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/auth/terminate.py", line 41, in terminate
2024-05-08T09:52:29.484138+00:00 app[web.1]: raise ConnectionError("Client is already terminated")
2024-05-08T09:52:29.484159+00:00 app[web.1]: ConnectionError: Client is already terminated
2024-05-08T09:52:29.652024+00:00 heroku[web.1]: Process exited with status 1
2024-05-08T09:52:29.675975+00:00 heroku[web.1]: State changed from starting to crashed

getting this error again and again even after trying with different string sessions

Traceback (most recent call last):
2024-05-09T12:15:42.251734+00:00 app[web.1]: File "", line 198, in _run_module_as_main
2024-05-09T12:15:42.251742+00:00 app[web.1]: File "", line 88, in _run_code
2024-05-09T12:15:42.251743+00:00 app[web.1]: File "/app/bot/main.py", line 54, in
2024-05-09T12:15:42.251876+00:00 app[web.1]: loop.run_until_complete(stop_clients())
2024-05-09T12:15:42.251903+00:00 app[web.1]: File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
2024-05-09T12:15:42.252001+00:00 app[web.1]: File "/app/bot/main.py", line 44, in stop_clients
2024-05-09T12:15:42.252061+00:00 app[web.1]: await gather(StreamBot.stop(), UserBot.stop())
2024-05-09T12:15:42.252087+00:00 app[web.1]: File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/utilities/stop.py", line 66, in stop
2024-05-09T12:15:42.252246+00:00 app[web.1]: await do_it()
2024-05-09T12:15:42.252250+00:00 app[web.1]: File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/utilities/stop.py", line 62, in do_it
2024-05-09T12:15:42.252320+00:00 app[web.1]: await self.terminate()
2024-05-09T12:15:42.252341+00:00 app[web.1]: File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/auth/terminate.py", line 41, in terminate
2024-05-09T12:15:42.252458+00:00 app[web.1]: raise ConnectionError("Client is already terminated")
2024-05-09T12:15:42.252484+00:00 app[web.1]: ConnectionError: Client is already terminated
2024-05-09T12:15:42.488970+00:00 heroku[web.1]: Process exited with status 1
2024-05-09T12:15:42.511876+00:00 heroku[web.1]: State changed from starting to crashed

400 AUTH_BYTES_INVALID

The thumbnail does not appear and the error log is as follows:
pyrogram.errors.exceptions.bad_request_400.AuthBytesInvalid: Telegram says: [400 AUTH_BYTES_INVALID] - The authorization bytes are invalid (caused by "auth.ImportAuthorization")

cloudflare

is it work with cloudflare workers..?

add feature

Git feature request:

1.Improve Telegram search functionality by implementing fuzzy matching, ignoring capitalization and small letters, and combining all search results into a single list.

2.Add a copy and paste option in search and web player for easily sharing links and text.

3.Introduce audio track selection in the web player for a more customized user experience.

4.Implement a "group channel feature" in the UI that mixes all listed channels' videos and ignores duplicates in the configuration.

5.enable speed limit for download in config

  1. add option to optimze for web player or download , preferred download or web streaming when multiple users are logged .
    @weebzone

ConnectionError: Client is already terminated

sudo docker run -p 8080:8080 surf-tg

22-May-24 07:48:55 AM - root - INFO - Successfully updated with latest commit from UPSTREAM_REPO
[22-May-24 07:49:00 AM] [INFO] - Initializing Surf-TG v-1.2.6
[22-May-24 07:49:02 AM] [INFO] - Bot Client : [@surf_tg_bot]
[22-May-24 07:49:02 AM] [ERROR] - Traceback (most recent call last):
  File "/app/bot/__main__.py", line 54, in <module>
    loop.run_until_complete(start_services())
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
  File "/app/bot/__main__.py", line 23, in start_services
    await UserBot.start()
  File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/utilities/start.py", line 59, in start
    is_authorized = await self.connect()
                    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/auth/connect.py", line 41, in connect
    await self.load_session()
  File "/usr/local/lib/python3.12/site-packages/pyrogram/client.py", line 661, in load_session
    await self.storage.open()
  File "/usr/local/lib/python3.12/site-packages/pyrogram/storage/memory_storage.py", line 60, in open
    dc_id, api_id, test_mode, auth_key, user_id, is_bot = struct.unpack(
                                                          ^^^^^^^^^^^^^^
struct.error: unpack requires a buffer of 271 bytes

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/app/bot/__main__.py", line 60, in <module>
    loop.run_until_complete(stop_clients())
  File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
  File "/app/bot/__main__.py", line 49, in stop_clients
    await UserBot.stop()
  File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/utilities/stop.py", line 66, in stop
    await do_it()
  File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/utilities/stop.py", line 62, in do_it
    await self.terminate()
  File "/usr/local/lib/python3.12/site-packages/pyrogram/methods/auth/terminate.py", line 41, in terminate
    raise ConnectionError("Client is already terminated")
ConnectionError: Client is already terminated

The bot runs without the SESSION_STRING fine. I've generated the SESSION_STRING on my machine with the colab code bc colab doesn't work.

help!!!!!

2024-05-08T12:11:18.691055+00:00 app[web.1]: [08-May-24 12:11:18 PM] [WARNING] - Python-dotenv could not parse statement starting at line 1118
2024-05-08T12:11:18.691120+00:00 app[web.1]: [08-May-24 12:11:18 PM] [WARNING] - Python-dotenv could not parse statement starting at line 1119
2024-05-08T12:11:18.691188+00:00 app[web.1]: [08-May-24 12:11:18 PM] [WARNING] - Python-dotenv could not parse statement starting at line 1120
2024-05-08T12:11:18.691271+00:00 app[web.1]: [08-May-24 12:11:18 PM] [WARNING] - Python-dotenv could not parse statement starting at line 1122
2024-05-08T12:11:18.691335+00:00 app[web.1]: [08-May-24 12:11:18 PM] [WARNING] - Python-dotenv could not parse statement starting at line 1123
2024-05-08T12:11:18.691494+00:00 app[web.1]: [08-May-24 12:11:18 PM] [WARNING] - Python-dotenv could not parse statement starting at line 1133
2024-05-08T12:11:18.691560+00:00 app[web.1]: [08-May-24 12:11:18 PM] [WARNING] - Python-dotenv could not parse statement starting at line 1135
2024-05-08T12:11:18.691844+00:00 app[web.1]: Traceback (most recent call last):
2024-05-08T12:11:18.691854+00:00 app[web.1]: File "", line 198, in _run_module_as_main
2024-05-08T12:11:18.691855+00:00 app[web.1]: File "", line 88, in _run_code
2024-05-08T12:11:18.691864+00:00 app[web.1]: File "/app/bot/main.py", line 8, in
2024-05-08T12:11:18.691998+00:00 app[web.1]: from bot.config import Telegram
2024-05-08T12:11:18.691998+00:00 app[web.1]: File "/app/bot/config.py", line 6, in
2024-05-08T12:11:18.692026+00:00 app[web.1]: class Telegram:
2024-05-08T12:11:18.692027+00:00 app[web.1]: File "/app/bot/config.py", line 7, in Telegram
2024-05-08T12:11:18.692065+00:00 app[web.1]: API_ID = int(getenv("API_ID"))
2024-05-08T12:11:18.692095+00:00 app[web.1]: ^^^^^^^^^^^^^^^^^^^^^
2024-05-08T12:11:18.692104+00:00 app[web.1]: TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
2024-05-08T12:11:18.841422+00:00 heroku[web.1]: Process exited with status 1
2024-05-08T12:11:18.861689+00:00 heroku[web.1]: State changed from starting to crashed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.