Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiktok模式: token_conf = dy_manager.get_config("douyin").get("msToken", None) AttributeError: 'NoneType' object has no attribute 'get' #17

Closed
joostshao opened this issue Jan 3, 2024 · 4 comments

Comments

@joostshao
Copy link

joostshao commented Jan 3, 2024

f2 tk -M one -u https://www.tiktok.com/@vietwhhore/video/7220605899159784747 -c tk.yaml
报错

    app_module = importlib.import_module(f"f2.apps.{app_name}.handler")
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/handler.py", line 10, in <module>
    from f2.apps.tiktok.crawler import TiktokCrawler
  File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/crawler.py", line 10, in <module>
    from f2.apps.tiktok.model import (
  File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/model.py", line 7, in <module>
    from f2.apps.douyin.utils import VerifyFpManager
  File "/usr/local/lib/python3.10/dist-packages/f2/apps/douyin/utils.py", line 36, in <module>
    class TokenManager:
  File "/usr/local/lib/python3.10/dist-packages/f2/apps/douyin/utils.py", line 38, in TokenManager
    token_conf = dy_manager.get_config("douyin").get("msToken", None)
AttributeError: 'NoneType' object has no attribute 'get'

➜ ~ f2 tk --init-config tk.yaml
tiktok 应用配置文件生成成功,保存至 /root/tk.yaml 配置文件已经生成完毕,但是一直报错提示sec_uid获取失败。
求助

@Johnserf-Seed
Copy link
Owner

视频链接用one模式, -M one

@joostshao
Copy link
Author

视频链接用one模式, -M one

f2 tk -M one -u https://www.tiktok.com/@vietwhhore/video/7220605899159784747 -c tk.yaml

已经使用 one 模式了,还是不行。

   asyncio.run(run_app(kwargs))
 File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
   return loop.run_until_complete(main)
 File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
   return future.result()
 File "/usr/local/lib/python3.10/dist-packages/f2/cli/cli_commands.py", line 144, in run_app
   app_module = importlib.import_module(f"f2.apps.{app_name}.handler")
 File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
   return _bootstrap._gcd_import(name[level:], package, level)
 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
 File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
 File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
 File "<frozen importlib._bootstrap_external>", line 883, in exec_module
 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/handler.py", line 10, in <module>
   from f2.apps.tiktok.crawler import TiktokCrawler
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/crawler.py", line 10, in <module>
   from f2.apps.tiktok.model import (
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/model.py", line 7, in <module>
   from f2.apps.douyin.utils import VerifyFpManager
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/douyin/utils.py", line 36, in <module>
   class TokenManager:
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/douyin/utils.py", line 38, in TokenManager
   token_conf = dy_manager.get_config("douyin").get("msToken", None)
AttributeError: 'NoneType' object has no attribute 'get'

这是需要登录账号吗?

@joostshao joostshao changed the title RuntimeError: 获取sec_uid失败 tiktok模式: token_conf = dy_manager.get_config("douyin").get("msToken", None) AttributeError: 'NoneType' object has no attribute 'get' Jan 4, 2024
@Johnserf-Seed
Copy link
Owner

视频链接用one模式, -M one

f2 tk -M one -u https://www.tiktok.com/@vietwhhore/video/7220605899159784747 -c tk.yaml

已经使用 one 模式了,还是不行。

   asyncio.run(run_app(kwargs))
 File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
   return loop.run_until_complete(main)
 File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
   return future.result()
 File "/usr/local/lib/python3.10/dist-packages/f2/cli/cli_commands.py", line 144, in run_app
   app_module = importlib.import_module(f"f2.apps.{app_name}.handler")
 File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
   return _bootstrap._gcd_import(name[level:], package, level)
 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
 File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
 File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
 File "<frozen importlib._bootstrap_external>", line 883, in exec_module
 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/handler.py", line 10, in <module>
   from f2.apps.tiktok.crawler import TiktokCrawler
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/crawler.py", line 10, in <module>
   from f2.apps.tiktok.model import (
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/tiktok/model.py", line 7, in <module>
   from f2.apps.douyin.utils import VerifyFpManager
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/douyin/utils.py", line 36, in <module>
   class TokenManager:
 File "/usr/local/lib/python3.10/dist-packages/f2/apps/douyin/utils.py", line 38, in TokenManager
   token_conf = dy_manager.get_config("douyin").get("msToken", None)
AttributeError: 'NoneType' object has no attribute 'get'

这是需要登录账号吗?

bc4c16b 这个推送修复了因为初始化配置文件导致的配置读取错误。等我更新pypi升级即可。

@Johnserf-Seed
Copy link
Owner

是需要登录账号的,不登陆的ck无法持久化的采集

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants