mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-04-29 19:24:28 +02:00
minor article template changes
This commit is contained in:
parent
2d6a3020aa
commit
3e79463330
12
main.py
12
main.py
@ -481,12 +481,14 @@ class Udemy:
|
||||
return _temp
|
||||
|
||||
def _extract_article(self, asset, id):
|
||||
return [{
|
||||
return [
|
||||
{
|
||||
"type": "article",
|
||||
"body": asset.get("body"),
|
||||
"extension": "html",
|
||||
"id": id,
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
||||
def _extract_ppt(self, asset, lecture_counter):
|
||||
_temp = []
|
||||
@ -1679,12 +1681,12 @@ def parse_new(udemy: Udemy, udemy_object: dict):
|
||||
|
||||
if asset_type == "article":
|
||||
body = asset.get("body")
|
||||
lecture_path = os.path.join(
|
||||
chapter_dir, "{}.html".format(sanitize_filename(lecture_title)))
|
||||
# stip the 03d prefix
|
||||
lecture_path = os.path.join(chapter_dir, "{}.html".format(sanitize_filename(lecture_title)))
|
||||
try:
|
||||
with open("./templates/article_template.html", "r") as f:
|
||||
content = f.read()
|
||||
content = content.replace("__title_placeholder__", lecture_title)
|
||||
content = content.replace("__title_placeholder__", lecture_title[4:])
|
||||
content = content.replace("__data_placeholder__", body)
|
||||
with open(lecture_path, encoding="utf8", mode="w") as f:
|
||||
f.write(content)
|
||||
|
@ -30,23 +30,26 @@
|
||||
margin: 0 auto;
|
||||
}
|
||||
.heading {
|
||||
margin-bottom: 2.4rem;
|
||||
margin-bottom: 24px;
|
||||
font-family: -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", Helvetica, Arial, sans-serif,
|
||||
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
letter-spacing: 0;
|
||||
font-size: 3.2rem;
|
||||
font-size: 32px;
|
||||
max-width: 36em;
|
||||
}
|
||||
.article-asset-container {
|
||||
padding: 2.4rem;
|
||||
}
|
||||
.article-asset-container p {
|
||||
font-size: 19px;
|
||||
}
|
||||
code {
|
||||
background-color: #fff;
|
||||
border: 1px solid #d1d7dc;
|
||||
color: #b4690e;
|
||||
font-size: 90%;
|
||||
font-size: 80%;
|
||||
padding: 0.2rem 0.4rem;
|
||||
font-family: sfmono-regular, Consolas, liberation mono, Menlo, Courier, monospace;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user