Code Monkey home page Code Monkey logo

Comments (5)

chenwei39094342 avatar chenwei39094342 commented on June 12, 2024

我也是这个问题
1.Douyin 2.TikTok: [1/2]: 1
INFO 主配置: conf/app.yaml
INFO 自定义配置: None

Traceback (most recent call last):
File "D:\Program Files\f2\TikTokTool.py", line 51, in
clisint(selected) - 1
File "D:\Program Files\f2\venv\Lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\f2\apps\douyin\cli.py", line 429, in douyin
ctx.invoke(set_cli_config, **kwargs)
File "D:\Program Files\f2\venv\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\f2\cli\cli_commands.py", line 134, in set_cli_config
asyncio.run(run_app(kwargs))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2032.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\f2\cli\cli_commands.py", line 142, in run_app
await app_module.main(kwargs)
File "D:\Program Files\f2\venv\Lib\site-packages\f2\apps\douyin\handler.py", line 865, in main
await mode_function_mapmode
File "D:\Program Files\f2\venv\Lib\site-packages\f2\apps\douyin\handler.py", line 159, in handle_one_video
aweme_data = await fetch_one_video(aweme_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\f2\apps\douyin\handler.py", line 196, in fetch_one_video
return video._to_dict()
^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\f2\apps\douyin\filter.py", line 745, in _to_dict
return {
^
File "D:\Program Files\f2\venv\Lib\site-packages\f2\apps\douyin\filter.py", line 746, in
prop_name: getattr(self, prop_name)
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\f2\apps\douyin\filter.py", line 538, in mix_create_time
return timestamp_2_str(
^^^^^^^^^^^^^^^^
File "D:\Program Files\f2\venv\Lib\site-packages\f2\utils\utils.py", line 79, in timestamp_2_str
return datetime.datetime.fromtimestamp(float(timestamp)).strftime(format)
^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'None'

from tiktokdownload.

lihe6666 avatar lihe6666 commented on June 12, 2024

我也是这个问题
image

from tiktokdownload.

ahlblzk avatar ahlblzk commented on June 12, 2024

确实单独下载一个链接的时候会报错 ValueError: could not convert string to float: 'None'

f2 dy -u https://www.douyin.com/video/7322134363515129099 -M one

from tiktokdownload.

wikil avatar wikil commented on June 12, 2024

#638 (comment)
找到f2包下的utils.py文件 ,形如 ...\venv\Lib\site-packages\f2\utils\utils.py

找到名为 timestamp_2_str 的函数->替换成下面的->保存->重新运行,应该就好了

def timestamp_2_str(
    timestamp: Union[str, int, float], format: str = "%Y-%m-%d %H-%M-%S"
) -> str:
    """
    将 UNIX 时间戳转换为格式化字符串 (Convert a UNIX timestamp to a formatted string)

    Args:
        timestamp (int): 要转换的 UNIX 时间戳 (The UNIX timestamp to be converted)
        format (str, optional): 返回的日期时间字符串的格式。
                                默认为 '%Y-%m-%d %H-%M-%S'。
                                (The format for the returned date-time string
                                Defaults to '%Y-%m-%d %H-%M-%S')

    Returns:
        str: 格式化的日期时间字符串 (The formatted date-time string)
    """
    print("timestamp is :",timestamp)
    if timestamp is None:
        return ""
    if timestamp == "None":
        return ""
    return datetime.datetime.fromtimestamp(float(timestamp)).strftime(format)

from tiktokdownload.

Johnserf-Seed avatar Johnserf-Seed commented on June 12, 2024

临时解决方案 Johnserf-Seed/f2#23 (comment)

from tiktokdownload.

Related Issues (20)

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.