Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more cmp, dspace providers #1044

Merged
merged 1 commit into from
May 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions core/loaders/harvest.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,29 @@ def clean_archive(ebf):
'libros.usc.edu.co',
'llibres.urv.cat',
'monografias.editorial.upv.es',
'monograph.com.ua',
'monographs.uc.pt',
'omp.ub.rub.de',
'openuctpress.uct.ac.za',
'omp.zrc-sazu.si',
'openpress.mtsu.edu',
'omp.ub.rub.de',
'penerbit.brin.go.id',
'Scholars Portal',
'teiresias-supplements.mcgill.ca',
'textbooks.open.tudelft.nl',
'unicapress.unica.it',
]

DSPACEPROVIDERS = [
'acikerisim.kapadokya.edu.tr',
'diposit.ub.edu',
'orbi.ulg.ac.be',
'orbi.uliege.be',
'publikationen.uni-tuebingen.de',
'',
]

DONT_HARVEST = [
'Unglue.it',
'Github',
Expand Down Expand Up @@ -177,8 +190,7 @@ def harvesters(ebook):
yield 'digitalcommons.usu.edu' in ebook.url, harvest_usu
yield ebook.provider == 'libros.fahce.unlp.edu.ar', harvest_fahce
yield ebook.provider in ['digital.library.unt.edu', 'texashistory.unt.edu'], harvest_unt
yield ebook.provider in ['diposit.ub.edu', 'orbi.ulg.ac.be', 'orbi.uliege.be',
'acikerisim.kapadokya.edu.tr',], harvest_dspace
yield ebook.provider in DSPACEPROVIDERS, harvest_dspace
yield ebook.provider == 'e-publish.uliege.be', harvest_liege
yield ebook.provider in CMPPROVIDERS, harvest_cmp
yield 'mdpi' in ebook.provider.lower(), harvest_mdpi
Expand Down Expand Up @@ -235,7 +247,6 @@ def harvesters(ebook):
yield ebook.provider == 'verlag.gta.arch.ethz.ch', harvest_gta
yield ebook.provider == 'manchesteruniversitypress.co.uk', harvest_manu
yield ebook.provider == 'tectum-elibrary.de', harvest_tecnum
yield ebook.provider == 'unicapress.unica.it', harvest_unicapress


def ebf_if_harvested(url):
Expand Down Expand Up @@ -824,7 +835,7 @@ def selector(doc):
yield obj

if not found:
objs = doc.select('.chapters a.cmp_download_link[href]')
objs = doc.select('.chapters a.cmp_download_link[href], .files a.cmp_download_link[href]')
if (len({obj['href'] for obj in objs})) > 1:
return []
return doc.select('a.cmp_download_link[href]')
Expand Down Expand Up @@ -1039,13 +1050,6 @@ def dl(url):
return url.replace('view', 'download') + '?inline=1'
return harvest_multiple_generic(ebook, selector, dl=dl)

def harvest_unicapress(ebook):
def selector(doc):
return doc.find_all('a', href=re.compile('catalog/view/'))
def dl(url):
return url.replace('view', 'download') + '?inline=1'
return harvest_multiple_generic(ebook, selector, dl=dl)


def harvest_topoi(ebook):
def selector(doc):
Expand Down