An Automated System for arXiv Article Downloading, Renaming, and Organizing into Specified Directories
发表于
Introduction
There is always a problem that has been bothering me: the articles
downloaded from Arxiv always have
unreadable names (e.g., 1210.2368v3).
Therefore, I would like to automatically rename the articles downloaded
from arXiv and move them to a specified folder instead of the system's
default download folder in an automated manner.
Tampermonkey
Search Tampermonkey in Microsoft
Edge Extensions, and downloand it.
If you prefer Chrome or Firefox, you may also find it in their
extensions stores.
Open tampermonkey and add a script as follows:
from flask import Flask, request, jsonify import os import shutil import time from flask_cors import CORS
app = Flask(__name__) CORS(app) # 启用CORS
# 配置参数 EDGE_DOWNLOAD_DIR = "C:/Users//Downloads"#Your edge download direction TARGET_DIR = "D:/MyDrive"#the direction you want to move the file to os.makedirs(TARGET_DIR, exist_ok=True)
# 添加测试路由 @app.route('/test', methods=['GET']) deftest_route(): print("测试路由被访问!") return"Hello from Flask!"
if __name__ == '__main__': app.run(host='0.0.0.0', port=5000, debug=True)
Hands-on operation
You have to run the python script and Tampermonkey at the same time,
so that you can implement the functions described in the introduction.
If the python script is named by your_script.py, create a
run_script.bat file in the same direction:
1 2
@echo off python %~dp0\your_script.py %*
Add run.bat to the PATH of your computer. Then, when you want to
download papers from arXiv, open cmd and type
run_script.