Git Product home page Git Product logo

tgindexpro's Introduction

Telegram Index Pro

Get your media streaming right from your telegram chat into VLC player and web player. No Downloads to wait for!! Easy to Share !!

Open Source Love GPLv3 license GitHub forks GitHub Stars

Deploy Now!

Highlights

  • Create permanent/Static links for your telegram index (No interruptions if deployed on repl.it )
  • Index of a selected channel/chat.
  • Stream/Play media directly in VLC player
  • View messages and media files on the browser.
  • Search through the channel/chat.
  • Download media files through browser/download managers.

Demo

website index

Bonus content

playlist creator

Deploy Guide

One Click Deploy (Easy):

Step 1:

Click here > Run on repl.it

Step 2:

Environment Variables. repl secrets sidebar

Add these Environment Variables (Secrets) in the sidebar

Variable Name Value
API_ID (required) Telegram api_id obtained from https://my.telegram.org/apps.
API_HASH (required) Telegram api_hash obtained from https://my.telegram.org/apps.
INDEXING_CHAT (required) Chat_ID of the chat you are using for index (add chat id echo bot to ur group or channel and make it admin to show chat id)

Step 3:

Press Run button on top.

  • Enter your phone number only (Bot token is not supported)

  • Enter the recieved OTP

  • Now copy the session string to the secrets.

Variable Name Value
SESSION_STRING (required) String obtained by running $ python3 app/generate_session_string.py. (Login with the telegram account which is a participant of the given channel (or chat).

Press Run button on top to start the webserver.

Step 4:

Preventing repl from going offline:

Open uptimerobot.com and add your index site under HTTP(s)

This will ping the site every 5 minutes and prevent repl from shutting down.

Manual Deployment:

  • Install dependencies.
 pip3 install -U -r requirements.txt
  • Environment Variables. PORT (optional) | Port on which app should listen to, defaults to 8080. HOST (optional) | Host name on which app should listen to, defaults to 0.0.0.0. DEBUG (optional) | Give some value to set logging level to debug, info by default.

  • Run app.

$ python3 -m app

API

Here's the api description. API

Contributions

Contributions are welcome.

Credits

Orignal Tgindex Developer @odysseusmax.

License

Code released under The GNU General Public License.

tgindexpro's People

Contributors

dgbkn avatar rayanfer32 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  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  avatar  avatar  avatar  avatar

tgindexpro's Issues

No working

I cannot run the project in repl.it,I hope to get help

getting error

was working fine 2-3 days ago , not even showing any error on console log
image

Repl.it deploy error.

i have already add 4 env value, here is the error infomation.

image
image

Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/runner/TgindexPro-1/app/main.py", line 19, in
Indexer().run()
File "/home/runner/TgindexPro-1/app/main.py", line 46, in run
self.loop.run_until_complete(self.startup())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/runner/TgindexPro-1/app/main.py", line 32, in startup
await setup_routes(self.server, Views(self.tg_client))
File "/home/runner/TgindexPro-1/app/routes.py", line 84, in setup_routes
alias_id = generate_alias_id(chat)
File "/home/runner/TgindexPro-1/app/routes.py", line 15, in generate_alias_id
title = chat.title
AttributeError: 'User' object has no attribute 'title'

Suspend

Heorko Suspend Account
in 10 second after Deploy

TV Addon

I am impressed and thank you for your work.

Would it be possible that you could provide a TV addon for Kodi.tv?

Best regards

Error: AttributeError: 'User' object has no attribute 'title'

I try to start the application locally.
I filled out: "API_ID", "API_HASH", "SESSION_String".

And "include_chats" = [1234567890] with my personal chat-id number. I used a bot called "RawDataBot" to fetch my chat-id.

It won't start and instead gives this error:

user@machine:~/TgindexPro$ python3 -m app
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/user/TgindexPro/app/__main__.py", line 19, in <module>
    Indexer().run()
  File "/home/user/TgindexPro/app/main.py", line 46, in run
    self.loop.run_until_complete(self.startup())
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/user/TgindexPro/app/main.py", line 32, in startup
    await setup_routes(self.server, Views(self.tg_client))
  File "/home/user/TgindexPro/app/routes.py", line 84, in setup_routes
    alias_id = generate_alias_id(chat)
  File "/home/user/TgindexPro/app/routes.py", line 15, in generate_alias_id
    title = chat.title
AttributeError: 'User' object has no attribute 'title'

Not showing files anymore

We can no longer see thr files from Telegram. It just showing a blank background. Can you fix it please ?

API ?

Does the API work?

When I try http://mydomain.com:8080/qMqVTrDyMoGCaX/api/ it does not work, using Postman with GET. I choose the channel, and append an /api to the url. Correct?

i Can't Generate Session String

python3 app/generate_session_string.py

Traceback (most recent call last):
File "app/generate_session_string.py", line 12, in
api_id = os.environ['API_ID']#int(input("Enter your API_ID: "))
File "/usr/lib/python3.8/os.py", line 675, in getitem
raise KeyError(key) from None
KeyError: 'API_ID'

Access with login

Hello could be added login with access? I never tried it in Python and it will be awesome to restrict the access so Repl.it don't target the accounts, thanks!

Buffering problem

Hi everyone, I have another issue.
I state that I have a Gigabit connection, so I think that the problem is not attributable to the connection.
I don't understand why there is buffering when I play my videos, I also notice that the buffer appears every time at the same point.
I hope someone can help me.

Error On Replit

 python3 run.py
ERROR:telethon.network.mtprotosender:Request caused struct.error: 'I' format requires 0 <= number <= 4294967295: GetUsersRequest(id=[InputUser(user_id=1001508344724, access_hash=0)])
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/runner/TgindexPro/app/main.py", line 19, in
Indexer().run()
File "/home/runner/TgindexPro/app/main.py", line 46, in run
self.loop.run_until_complete(self.startup())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/runner/TgindexPro/app/main.py", line 32, in startup
await setup_routes(self.server, Views(self.tg_client))
File "/home/runner/TgindexPro/app/routes.py", line 83, in setup_routes
chat = await client.get_entity(chat_id)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/client/users.py", line 287, in get_entity
inputs.append(await self.get_input_entity(x))
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/client/users.py", line 440, in get_input_entity
users = await self(functions.users.GetUsersRequest([
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/client/users.py", line 30, in call
return await self._call(self._sender, request, ordered=ordered)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/client/users.py", line 58, in _call
future = sender.send(request, ordered=ordered)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/network/mtprotosender.py", line 176, in send
state = RequestState(request)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/network/requeststate.py", line 17, in init
self.data = bytes(request)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/tl/tlobject.py", line 194, in bytes
return self._bytes()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/tl/functions/users.py", line 72, in _bytes
b'\x15\xc4\xb5\x1c',struct.pack('<i', len(self.id)),b''.join(x._bytes() for x in self.id),
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/tl/functions/users.py", line 72, in
b'\x15\xc4\xb5\x1c',struct.pack('<i', len(self.id)),b''.join(x._bytes() for x in self.id),
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/tl/types/init.py", line 11928, in _bytes
struct.pack('<I', self.user_id)

error

hi , i am getting this error code. any idea to reslove ?

File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/runner/TgindexPro/app/main.py", line 19, in
Indexer().run()
File "/home/runner/TgindexPro/app/main.py", line 25, in init
self.tg_client = Client(session_string, api_id, api_hash)
File "/home/runner/TgindexPro/app/telegram.py", line 11, in init
super().init(StringSession(session_string), *args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/sessions/string.py", line 37, in init
self._dc_id, ip, self._port, key = struct.unpack(
struct.error: unpack requires a buffer of 275 bytes
exit status 1

Please Help to Run

Hi

When I Get Code in Telegram and Insert to app
Show Blow Error
Please Help For Deployment.
TGIndex Problem

M3U links/files from OTG not working.

M3U links/files work fine with the default index but when generated with the OTG indexing, M3U links/files doesn't play with VLC. Here are the VLC error logs ~

-- logger module started --
main: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
main: playlist is empty
-- logger module stopped --
-- logger module started --
main: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
access error: HTTP 410 error
http error: local stream 1 error: Cancellation (0x8)
-- logger module stopped --

video player

videos with dual audio or subtitle can't be played in online player..
so please do something about it.

Sort the files in ascending order

Is it possible to sort the files in ascending order. (From 1st message to the last)
This will be really helpful for channels with TV shows.

I can't generate session string

Every time I try to generate session string it gave me the error

Traceback (most recent call last):
File "app/generate_session_string.py", line 12, in
api_id = os.environ['API_ID']#int(input("Enter your API_ID: "))
File "/usr/lib/python3.8/os.py", line 675, in getitem
raise KeyError(key) from None
KeyError: 'API_ID'

But all the keys are not blank

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.