changes nathan

This commit is contained in:
NohamR 2023-09-10 02:02:38 +02:00
parent 7ac5a429b4
commit 8cbe348125
2 changed files with 20 additions and 9 deletions

View File

@ -71,6 +71,19 @@
</div> </div>
</div> </div>
<div>
<h1>Liens rapides :</h1>
<button onclick="changerURL(9782091317243, 'nathan')">
<h1>Maths Ex</h1>
</button>
<button onclick="changerURL(9782091317113, 'nathan')">
<h1>Maths Spe</h1>
</button>
<!-- <button onclick="changerURL(9782017102120, 'hachette')">
<h1></h1>
</button> -->
</div>
<!-- <div> <!-- <div>
<h1>Liens rapides :</h1> <h1>Liens rapides :</h1>
<button onclick="changerURL(9782017102106, 'hachette')"> <button onclick="changerURL(9782017102106, 'hachette')">
@ -221,12 +234,10 @@
else if (editionchoisie == 'nathan') { else if (editionchoisie == 'nathan') {
console.log("nathan"); console.log("nathan");
document.getElementById("editionesthcoisieest").innerHTML = ""; document.getElementById("editionesthcoisieest").innerHTML = "";
diviframe.style.display = ''; diviframe.style.display = 'none';
slider.style.display = ''; slider.style.display = '';
divimg.style.display = 'none'; divimg.style.display = '';
divserver.style.display = 'none'; divserver.style.display = 'none';
document.documentElement.style.setProperty('--iframe-width', '1152px');
document.documentElement.style.setProperty('--iframe-height', '1594px');
} }
else { else {
document.getElementById("editionesthcoisieest").innerHTML = "&#9888 Cette édition n'est pas encore supportée &#9888"; document.getElementById("editionesthcoisieest").innerHTML = "&#9888 Cette édition n'est pas encore supportée &#9888";
@ -298,8 +309,8 @@
iframe2.src = newUrl2; iframe2.src = newUrl2;
} }
else if (editionchoisie == 'nathan') { else if (editionchoisie == 'nathan') {
var newUrl1 = "https://raw.githubusercontent.com/NohamR/Manuelcontent/main/Nathan/" + code + "/page0.jpg"; var newUrl1 = "https://raw.githubusercontent.com/NohamR/Manuelcontent/main/Nathan/" + code + "/page1.jpg";
var newUrl2 = "https://raw.githubusercontent.com/NohamR/Manuelcontent/main/Nathan/" + code + "/page1.jpg"; var newUrl2 = "https://raw.githubusercontent.com/NohamR/Manuelcontent/main/Nathan/" + code + "/page2.jpg";
img1.src = newUrl1; img1.src = newUrl1;
img2.src = newUrl2; img2.src = newUrl2;
} }

View File

@ -8,7 +8,7 @@ import re
def getimg(url, nb): def getimg(url, nb):
response = requests.get(url) response = requests.get(url)
if response.status_code == 200: if response.status_code == 200:
save_path = f"9782091317243/{nb}.jpg" save_path = f"9782091317113/{nb}.jpg"
with open(save_path, 'wb') as file: with open(save_path, 'wb') as file:
file.write(response.content) file.write(response.content)
print(f"The image has been saved as '{save_path}'") print(f"The image has been saved as '{save_path}'")
@ -16,8 +16,8 @@ def getimg(url, nb):
print(f"Failed to download the image. Status code: {response.status_code}") print(f"Failed to download the image. Status code: {response.status_code}")
url = 'https://biblio.nathan.fr/epubs/web/4ebeff9ce5eb568f8142771fdac580b8aeb12f675d75fa4c1ebb4620050d6c01842394910eeee327/NATHAN/bibliomanuels/distrib_gp/2/1/10300/online/OEBPS/TOC.xhtml' url = 'https://biblio.nathan.fr/epubs/web/4ebeff9ce5eb568f8142771fdac580b8aeb12f675d75fa4c1ebb4620050d6c01842394910eeee327/NATHAN/bibliomanuels/distrib_gp/2/1/10366/online/OEBPS/TOC.xhtml'
debut = 'https://biblio.nathan.fr/epubs/web/4ebeff9ce5eb568f8142771fdac580b8aeb12f675d75fa4c1ebb4620050d6c01842394910eeee327/NATHAN/bibliomanuels/distrib_gp/2/1/10300/online/OEBPS/' debut = 'https://biblio.nathan.fr/epubs/web/4ebeff9ce5eb568f8142771fdac580b8aeb12f675d75fa4c1ebb4620050d6c01842394910eeee327/NATHAN/bibliomanuels/distrib_gp/2/1/10366/online/OEBPS/'
r = requests.get(url) r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser') soup = BeautifulSoup(r.text, 'html.parser')
pagelist = soup.find('nav', {'epub:type': 'page-list'}) pagelist = soup.find('nav', {'epub:type': 'page-list'})