Skip to content

Commit

Permalink
config.json
Browse files Browse the repository at this point in the history
downloadNewArticles.py
reTitlePDFs.py
  • Loading branch information
distbit0 committed Jan 22, 2025
1 parent cb139e6 commit 96767f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"folders": [
"YTvideo"
]
}
},
"interpersonal": {
"folders": [
"Philosophy/conversation and relationships"
Expand Down
4 changes: 2 additions & 2 deletions src/downloadNewArticles.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def save_webpage_as_mhtml(url, timeout=10, min_load_time=5):
def save_mobile_article_as_mhtml(url, saveDirectory, timeout=10, min_load_time=5):
originalUrl = url
try:
response = requests.get(url, verify=False)
response = requests.get(url, verify=False, timeout=timeout)
except requests.exceptions.SSLError:
url = url.replace("https", "http")
response = requests.get(url, verify=False)
response = requests.get(url, verify=False, timeout=timeout)

content_type = response.headers.get("Content-Type")
content_disposition = response.headers.get("Content-Disposition")
Expand Down
2 changes: 1 addition & 1 deletion src/reTitlePDFs.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_id_type(paper_id):
def getPDFTitle(pdfPath):
pdfTitle = ""
originalFileName = pdfPath.split("/")[-1]
pdfTitle = os.popen('python3 -m pdftitle -p "' + pdfPath + '"').read()
pdfTitle = os.popen('pdftitle -p "' + pdfPath + '"').read()
if (not pdfTitle) or len(pdfTitle) < 4:
pdfTitle = originalFileName[:-4]
idType = get_id_type(pdfTitle)
Expand Down

0 comments on commit 96767f8

Please sign in to comment.