Giter VIP home page Giter VIP logo

Comments (8)

XMYSTERlOUSX avatar XMYSTERlOUSX commented on May 25, 2024

@khannhyder888 Deployed two times now with and without mega credentials. No error is being occured! That means you have entered something wrongly in your config vars. Probably in Mega_email or in Mega_password. If you are not using any mega account (mega credentials) when deploying keep the value exactly as "None" in both the fields Mega_email and Mega_password.

I think you have cut those fields from heroku or haven't entered any value in those fields! So if you are not using any mega account, without removing those fields or deleting the value in those fields enter exactly "None" in both of them.

If any error occurs again update here! Thank you.

from mega-link-downloader-bot.

khannhyder888 avatar khannhyder888 commented on May 25, 2024

@khannhyder888 Deployed two times now with and without mega credentials. No error is being occured! That means you have entered something wrongly in your config vars. Probably in Mega_email or in Mega_password. If you are not using any mega account (mega credentials) when deploying keep the value exactly as "None" in both the fields Mega_email and Mega_password.

I think you have cut those fields from heroku or haven't entered any value in those fields! So if you are not using any mega account, without removing those fields or deleting the value in those fields enter exactly "None" in both of them.

If any error occurs again update here! Thank you.

Hello @XMYSTERlOUSX , thank you so much for being quick in responding. I'm attaching a screenshot of the config file. (https://user-images.githubusercontent.com/78749214/130927616-e799bce1-74ba-4003-9d77-0ef03432f294.png)
I just insert the values that need inserting.

And I'm trying to make it work on a VPS.

from mega-link-downloader-bot.

XMYSTERlOUSX avatar XMYSTERlOUSX commented on May 25, 2024

@khannhyder888 Deployed two times now with and without mega credentials. No error is being occured! That means you have entered something wrongly in your config vars. Probably in Mega_email or in Mega_password. If you are not using any mega account (mega credentials) when deploying keep the value exactly as "None" in both the fields Mega_email and Mega_password.
I think you have cut those fields from heroku or haven't entered any value in those fields! So if you are not using any mega account, without removing those fields or deleting the value in those fields enter exactly "None" in both of them.
If any error occurs again update here! Thank you.

Hello @XMYSTERlOUSX , thank you so much for being quick in responding. I'm attaching a screenshot of the config file. (https://user-images.githubusercontent.com/78749214/130927616-e799bce1-74ba-4003-9d77-0ef03432f294.png)
I just insert the values that need inserting.

And I'm trying to make it work on a VPS.

@khannhyder888 Oh! my bad. I forgot the inverted commas. Please put " before and after the word None in the both fields Mega_email and Mega_password !

As an example it should be like below. 👇

Mega_email = os.environ.get("Mega_email", "None")
Mega_password = os.environ.get("Mega_password", "None")

Thank you for taking your time and showing this bug! I will update the repo now!

from mega-link-downloader-bot.

khannhyder888 avatar khannhyder888 commented on May 25, 2024

Hi @XMYSTERlOUSX , thanks for updating me about the quotes. But now I'm getting this error

2021-08-26 14:11:02,139 - pyrogram.crypto.aes - INFO - Using TgCrypto
Traceback (most recent call last):
  File "bot.py", line 16, in <module>
    from pyrogram import Client, idle
ImportError: cannot import name 'idle' from 'pyrogram' (/usr/local/lib/python3.8/dist-packages/pyrogram/__init__.py)

What could be the reason?

from mega-link-downloader-bot.

XMYSTERlOUSX avatar XMYSTERlOUSX commented on May 25, 2024

Hi @XMYSTERlOUSX , thanks for updating me about the quotes. But now I'm getting this error

2021-08-26 14:11:02,139 - pyrogram.crypto.aes - INFO - Using TgCrypto
Traceback (most recent call last):
  File "bot.py", line 16, in <module>
    from pyrogram import Client, idle
ImportError: cannot import name 'idle' from 'pyrogram' (/usr/local/lib/python3.8/dist-packages/pyrogram/__init__.py)

What could be the reason?

@khannhyder888 Hmm...Strange! I can't think of a reason for this...Maybe occuring because of your pyrogram version! Can you say what is your pyrogram version please?

You can get your pyrogram version by creating a simple python file, let's say named example.py like below.

import pyrogram
print(pyrogram.__version__)

Then after saving this and by running it like python3 example.py you can get your pyrogram version!

Well the "idle" thing is not so important! So you can remove it completely from your bot.py as a solution for this. Just edit the bot.py as below and if any other pyrogram errors do not occur, the bot will be running successfully!

import logging
logging.basicConfig(level=logging.DEBUG,
                    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)

import os

# the secret configuration specific things
if bool(os.environ.get("WEBHOOK", False)):
    from sample_config import Config
else:
    from config import Config

import pyrogram
logging.getLogger("pyrogram").setLevel(logging.WARNING)
from pyrogram import Client
if __name__ == "__main__" :
    # Creating essential directories, if they does not exists
    if not os.path.isdir(Config.DOWNLOAD_LOCATION):
        os.makedirs(Config.DOWNLOAD_LOCATION)
    if not os.path.isdir(Config.ADMIN_LOCATION):
        os.makedirs(Config.ADMIN_LOCATION)
    if not os.path.isdir(Config.CREDENTIALS_LOCATION):
        os.makedirs(Config.CREDENTIALS_LOCATION)        
    plugins = dict(
        root="plugins"
    )
    app = pyrogram.Client(
        "Mega_Link_Downloader_Bot",
        bot_token=Config.TG_BOT_TOKEN,
        api_id=Config.APP_ID,
        api_hash=Config.API_HASH,
        plugins=plugins
    )
    app.run()

Update here if any other error occurs! Thank you.

from mega-link-downloader-bot.

khannhyder888 avatar khannhyder888 commented on May 25, 2024

Now I'm getting this error

Traceback (most recent call last):
  File "bot.py", line 35, in <module>
    app.run()
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client/client.py", line 984, in run
    self.start()
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client/client.py", line 840, in start
    self.initialize()
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client/client.py", line 303, in initialize
    self.load_plugins()
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client/client.py", line 1503, in load_plugins
    module = import_module(module_path)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/root/mega-link-downloader-bot/plugins/blacklist.py", line 1, in <module>
    from pyrogram import Client, filters
ImportError: cannot import name 'filters' from 'pyrogram' (/usr/local/lib/python3.8/dist-packages/pyrogram/__init__.py)

Pyrogram version is 0.16.0

from mega-link-downloader-bot.

XMYSTERlOUSX avatar XMYSTERlOUSX commented on May 25, 2024

Now I'm getting this error

Traceback (most recent call last):
  File "bot.py", line 35, in <module>
    app.run()
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client/client.py", line 984, in run
    self.start()
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client/client.py", line 840, in start
    self.initialize()
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client/client.py", line 303, in initialize
    self.load_plugins()
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client/client.py", line 1503, in load_plugins
    module = import_module(module_path)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/root/mega-link-downloader-bot/plugins/blacklist.py", line 1, in <module>
    from pyrogram import Client, filters
ImportError: cannot import name 'filters' from 'pyrogram' (/usr/local/lib/python3.8/dist-packages/pyrogram/__init__.py)

Pyrogram version is 0.16.0

@khannhyder888 Yeah your pyrogram version is the problem! You should upgrade it. You can do it by running the following command.

pip3 install -U pyrogram tgcrypto

If it goes correctly your pyrogram version should be 1.2.9.

from mega-link-downloader-bot.

khannhyder888 avatar khannhyder888 commented on May 25, 2024

Hello @XMYSTERlOUSX

I'm confirming the bot is working after updating the pyrogram.

Thanks for all the help.

from mega-link-downloader-bot.

Related Issues (17)

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.