GithubHelp home page GithubHelp logo

yuque-export's Introduction

██╗   ██╗██╗   ██╗ ██████╗ ██╗   ██╗███████╗    ███████╗██╗  ██╗██████╗  ██████╗ ██████╗ ████████╗
╚██╗ ██╔╝██║   ██║██╔═══██╗██║   ██║██╔════╝    ██╔════╝╚██╗██╔╝██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝
 ╚████╔╝ ██║   ██║██║   ██║██║   ██║█████╗█████╗█████╗   ╚███╔╝ ██████╔╝██║   ██║██████╔╝   ██║
  ╚██╔╝  ██║   ██║██║▄▄ ██║██║   ██║██╔══╝╚════╝██╔══╝   ██╔██╗ ██╔═══╝ ██║   ██║██╔══██╗   ██║
   ██║   ╚██████╔╝╚██████╔╝╚██████╔╝███████╗    ███████╗██╔╝ ██╗██║     ╚██████╔╝██║  ██║   ██║
   ╚═╝    ╚═════╝  ╚══▀▀═╝  ╚═════╝ ╚══════╝    ╚══════╝╚═╝  ╚═╝╚═╝      ╚═════╝ ╚═╝  ╚═╝   ╚═╝
                                                                            by Natro92

这几天在搞Obsidian,想把内容本地化一下,但是一个一个导出太费劲了,就简单写了一个demo。

本项目无需使用语雀的Token。但是需要使用Cookie来进行登录。

使用方法

  • 安装依赖
pip install -r requirements.txt
  • 获取Cookie

登录 语雀 后,在主页 F12 打开开发者工具。切换至网络栏,刷新页面,复制框选内容粘贴至程序根目录的cookie.txt中。 image.png

  • 到程序根目录下运行
python yuque-export.py
  • 运行截图

image.png 结果保存在程序根目录下output文件夹中,保存速度可能与网速有关,我测试时设置0.5-0.8s延迟时约1.5s一个md文件。 你可以在config/settings.py中修改参数配置:

# * 文件导出路径 默认为项目文件夹下的output文件夹 或者修改为绝对路径
save_place = "output"

# * 是否显示详细信息 1 为显示 0 为不显示
show_detailed = 0

# * 每次导出休眠时间,随机为 wait_time 到 wait_time + wait_time_delta 之间的数
# * 比如 wait_time = 0.2, wait_time_delta = 0.1, 则每次导出的等待时间为 0.2 到 0.3 秒之间
is_wait = 1  # * 是否开启等待 1 为开启 0 为关闭,目前关闭有Bug,待修 如果出现cannot access local variable 'text_data' where it is not associated with a value 可能就需要调大点了
wait_time = 0.5
wait_time_delta = 0.3

# * 导出设置
attachment = "true"  # * 导出 LaTeX 公式图片
latexcode = "false"  # * 导出 LaTeX 公式为 Markdown 语法
anchor = "false"  # * 导出保持语雀的锚点
linebreak = "false"  # * 导出保持语雀的换行

修改这部分可能会有点小bug,注意事项我都卸载里面了。 注意:本版本未支持导出图片至本地,原因是Obsidian的一些插件似乎支持这个功能,另一个原因是本来用来使用的Hexo,是可以通过不传referrer来绕过防盗链检测的,详情可以看:

yuque-export's People

Contributors

natro92 avatar

Stargazers

pysnow avatar orxiain. avatar  avatar  avatar J_JWei avatar Zhang Jiashu avatar 咸鱼 avatar  avatar  avatar

Watchers

 avatar

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.