douyin_spider icon indicating copy to clipboard operation
douyin_spider copied to clipboard

运行报错

Open dkerjw1 opened this issue 5 years ago • 0 comments

使用的示例代码 ` from douyin_spider.downloaders.video import VideoDownloader from douyin_spider.handler.video import VideoHandler from douyin_spider.handler.music import MusicHandler from douyin_spider.handler.mongodb import MongoHandler from douyin_spider.enter.hot_top import hot_top20

video_handler = VideoHandler(folder='./videos') music_handler = MusicHandler(folder='./musics') mongo_handler = MongoHandler() downloader = VideoDownloader([video_handler,music_handler,mongo_handler])

result = hot_top20()

for item in result.data: downloader.download(item)

print("success") `

执行命令结果报错 `A:douyin_spider mmm$ python douyin.py

Traceback (most recent call last): File "douyin.py", line 2, in from douyin_spider.handler.video import VideoHandler File "/Users/mengqingyue/anaconda3/lib/python3.5/site-packages/douyin_spider/handler/video.py", line 1, in from douyin_spider.handler.media import MediaHandler File "/Users/mengqingyue/anaconda3/lib/python3.5/site-packages/douyin_spider/handler/media.py", line 54 media_save_path = Path(self.folder).joinpath(f"{item.id}.{extension}") ^ SyntaxError: invalid syntax `

操作系统时MacOS, Python版本为3.5,请问该怎么办呢?

dkerjw1 avatar Oct 20 '19 16:10 dkerjw1