Giter Site home page Giter Site logo

silenceeagle / paper_downloader Goto Github PK

View Code? Open in Web Editor NEW
224.0 224.0 30.0 3.17 MB

Download papers and supplemental materials from open-access paper website, such as AAAI, AISTATS, COLT, CORL, CVPR, ECCV, ICCV, ICLR, ICML, IJCAI, JMLR, NIPS, RSS, WACV.

License: MIT License

Python 100.00%
aaai accv aistats colt cvpr eccv iccv iclr icml ijcai jmlr nips paper-download rss wacv

paper_downloader's Introduction

Hi there 👋

GitHub Stats Card

paper_downloader's People

Contributors

silenceeagle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

paper_downloader's Issues

我来增加一个aamas会议的批量下载,很简单的代码,我就不pull了~

作者有空,可以加一下~

import multiprocessing
from multiprocessing import Pool
import requests
from bs4 import BeautifulSoup
import os
import re

def validateTitle(title):
    rstr = r"[\/\\\:\*\?\"\<\>\|]"
    new_title = re.sub(rstr, "_", title)
    return new_title

def fix_file_path(file_path):
    file_path = re.sub(r'[\r]+', ' ', file_path)
    file_path = re.sub(r'[\n]+', ' ', file_path)
    file_path = re.sub(r'\s{2,}', ' ', file_path)
    return file_path

def download_pdf(args):
    # print("args", args)
    pdf_url, pdf_file = args    
    with open(pdf_file, "wb") as f:
        f.write(requests.get(pdf_url).content)
    print(f"Downloaded {pdf_file} from {pdf_url}")
    
    
    
if __name__ == '__main__':    
    year = 2020
    url = "https://www.ifaamas.org/Proceedings/aamas{}/forms/contents.htm".format(year)
    response = requests.get(url)
    soup = BeautifulSoup(response.content, "html.parser")

    if not os.path.exists("aamas{}".format(year)):
        os.makedirs("aamas{}".format(year))

    tasks = []

    pdf_urls = []
    pdf_files = []
    titles = []
    for a in soup.find_all("a", href=True):
        if a["href"].endswith(".pdf"):
            title = a.text.strip()
            title = validateTitle(title)
            pdf_url = "https://www.ifaamas.org/Proceedings/aamas{}/".format(year) + a["href"].split("../")[-1]
            pdf_file = "aamas{}/".format(year) + title + ".pdf"
            pdf_file = fix_file_path(pdf_file)                
            if "https://www.ifaamas.org/Proceedings/aamas{}/pdfs/p".format(year) in pdf_url:
                pdf_urls.append(pdf_url)
                pdf_files.append(pdf_file)
                titles.append(title)

    # 使用多进程获取文章信息
    with Pool(8) as p:
        p.map(download_pdf, zip(pdf_urls, pdf_files))

MAC用户怎么办?

如题。我用mac系统,下载pywin32库的时候一直报错,尝试几番也没有解决问题。对应代码在:from win32com.client import Dispatch。可以帮帮我吗?

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.