diff --git a/setup.py b/setup.py index b130413..1f947b0 100644 --- a/setup.py +++ b/setup.py @@ -10,8 +10,8 @@ # This call to setup() does all the work setup( name="telegram-cloud", - version="1.4.3", - description="Download and upload files via telegram up to 1.5GB, CLI", + version="1.4.4", + description="Download and upload files via telegram up to 2 GB, CLI", long_description=README, long_description_content_type="text/markdown", url="https://github.com/iw4p/telegram-cloud", diff --git a/snippet.txt b/snippet.txt new file mode 100644 index 0000000..d1822b2 --- /dev/null +++ b/snippet.txt @@ -0,0 +1,44 @@ +cd funniest +python3 setup.py sdist bdist_wheel\n +cd Desktop/funniestnima +rm -rf funniestnima.egg-info build dist +python3 setup.py sdist bdist_wheel +python3 -m twine check dist/* +python3 -m twine upload dist/* +pip install funniestnima==0.2 + +dev package + +python3 -m pip uninstall -e . +pip3 uninstall telegram-cloud +python3 setup.py sdist +pip3 list +python3 setup.py bdist_wheel +ls -ltrh +pip3 install -e . +pip3 uninstall telegram-cloud +pip3 install -e . + +# Search in chats for sending Retrieving +""" +This function is good for searching between all conversations without knowing the telegram Username or telegram UserID +But it is not useful and enable, maybe later, maybe never +""" +# async def chat_iter(client, search_for_name): +# my_private_channel_id = None +# my_private_channel = None + +# async for dialog in client.iter_dialogs(): +# if dialog.name == search_for_name: +# my_private_channel = dialog +# my_private_channel_id = dialog.id +# break + +# print(my_private_channel) +# print(my_private_channel_id) +# if search_for_name is None: +# return "chat not found" +# else: +# return my_private_channel_id + +# conversation_name = await chat_iter(client, username) diff --git a/telegramcloud/__main__.py b/telegramcloud/__main__.py index ef4bb47..88fcbc1 100755 --- a/telegramcloud/__main__.py +++ b/telegramcloud/__main__.py @@ -33,19 +33,22 @@ def download_callback(current, total): def upload_callback(current, total): print('Uploaded', current, 'out of', total, 'bytes: {:.2%}'.format(current / total)) + async def main(): # Get target username username = args.username target_chat = await target_username_handler(client, username) + # Retrieve and download a file from its name or caption, from specific target_chat if args.mode == 'download': if args.caption and args.path and username: - async for message in client.iter_messages(entity=username, search=args.caption): + async for message in client.iter_messages(entity=target_chat, search=args.caption): try: await client.download_media(message, args.path, progress_callback=download_callback) except: + print('ridam') pass