| ... | ... |
@@ -1,4 +1,5 @@ |
| 1 | 1 |
*.pyc |
| 2 | 2 |
__pycache__ |
| 3 | 3 |
output.log |
| 4 |
+.*.swp |
|
| 4 | 5 |
|
| ... | ... |
@@ -18,82 +18,95 @@ csvFilename = None |
| 18 | 18 |
connectionResults = None |
| 19 | 19 |
|
| 20 | 20 |
def getManganeloTV(url): |
| 21 |
- debug("Downloading: "+url)
|
|
| 22 |
- r = requests.get(url, allow_redirects=True) |
|
| 23 |
- content = r.text |
|
| 24 |
- #print(r.text) |
|
| 25 |
- lineNextChapter = None |
|
| 26 |
- linePreviousChapter = None |
|
| 27 |
- lineTitle = None |
|
| 28 |
- linkNext = None |
|
| 29 |
- linkPrev = None |
|
| 30 |
- listImages = [] |
|
| 31 |
- for line in content.split("\n"):
|
|
| 32 |
- if "navi-change-chapter-btn-prev a-h" in line and linePreviousChapter is None: |
|
| 33 |
- linePreviousChapter = line |
|
| 34 |
- elif "navi-change-chapter-btn-next a-h" in line and lineNextChapter is None: |
|
| 35 |
- lineNextChapter = line |
|
| 36 |
- elif "<meta property=\"og:title\" content=\"" in line and lineTitle is None: |
|
| 37 |
- lineTitle = line |
|
| 38 |
- elif "<img class=\"img-loading\" data-src=\"" in line: |
|
| 39 |
- listImages.append(line.split("\"")[3])
|
|
| 40 |
- |
|
| 41 |
- #debug(str(len(listImages))) |
|
| 42 |
- if 0 == len(listImages): |
|
| 43 |
- # Attempt to extract images once more, most likely all are on one line |
|
| 44 |
- for line in content.split("\n"):
|
|
| 45 |
- if " page " in line: |
|
| 46 |
- for subLine in line.split("><"):
|
|
| 47 |
- # ~ if "https://" in subLine.split("\"")[1]:
|
|
| 48 |
- if "https://" in subLine: |
|
| 49 |
- listImages.append(subLine.split("\"")[1])
|
|
| 50 |
- |
|
| 51 |
- if lineNextChapter is not None: |
|
| 52 |
- linkNext="https://manganelo.tv"+lineNextChapter.split("\"")[5]
|
|
| 53 |
- if linePreviousChapter is not None: |
|
| 54 |
- linkPrev="https://manganelo.tv"+linePreviousChapter.split("\"")[5]
|
|
| 55 |
- mangaTitle=lineTitle.split("\"")[3].split(" - Manganelo")[0]
|
|
| 56 |
- say("Manga :"+mangaTitle)
|
|
| 57 |
- pageContent = "" |
|
| 58 |
- pageContent += "<div class=\"mangaChapNavig\">\n" |
|
| 59 |
- pageContent += " <div class=\"mangaTitle\">"+mangaTitle+"</div>\n" |
|
| 60 |
- pageContent += "<div class=\"mangaRead\" onclick=\"onArticle(0)\">📖</div>" |
|
| 61 |
- if linkPrev is not None: |
|
| 62 |
- pageContent += " <div class=\"mangaChapNavigPrev\"><a href=?url="+linkPrev+">⮜</a></div>\n" |
|
| 63 |
- if linkNext is not None: |
|
| 64 |
- pageContent += " <div class=\"mangaChapNavigNext\"><a href=?url="+linkNext+">⮞</a></div>\n" |
|
| 65 |
- pageContent += " <div class=\"mangaChapNavigHome\"><a href=\"/\">⮝</a></div>\n" |
|
| 66 |
- pageContent += "</div>\n" |
|
| 67 |
- |
|
| 68 |
- pageContent += "<a name=\"article-top\"></a><div id=\"article-current\"></div>\n" |
|
| 69 |
- # ~ pageContent += "<div id=\"album-list\" class=\"empty-list\">\n" |
|
| 70 |
- pageContent += "<div class=\"row\">" |
|
| 71 |
- cpt = 0 |
|
| 72 |
- for pageImage in listImages: |
|
| 73 |
- #debug(pageImage) |
|
| 74 |
- pageContent += "<div class=\"article\" id=\"article-"+str(cpt)+"\" style=\"display: none;\">\n" |
|
| 75 |
- pageContent += " <div class=\"column\" id=\"colLeft\" onclick=\"onArticle("+str(cpt-1)+")\">\n"
|
|
| 76 |
- pageContent += " ⮜\n" |
|
| 77 |
- pageContent += " </div><!-- /column colLeft -->\n" |
|
| 78 |
- |
|
| 79 |
- pageContent += " <div class=\"column\" id=\"colMiddle\">\n" |
|
| 80 |
- pageContent += " <a name=\"article-"+str(cpt)+"\">\n" |
|
| 81 |
- pageContent += " <div class=\"extract-content\" id=\""+str(cpt)+"\">\n" |
|
| 82 |
- pageContent += " <li><img src=\"defer.png\" data-src=\""+pageImage+"\"></li>\n" |
|
| 83 |
- # ~ pageContent += " <img src=\""+pageImage+"\">\n" |
|
| 84 |
- # ~ pageContent += " <li>"+str(cpt)+" : "+pageImage+"</li>\n" |
|
| 85 |
- pageContent += " </div>\n" |
|
| 86 |
- pageContent += " </div><!-- /column colMiddle -->\n" |
|
| 87 |
- |
|
| 88 |
- pageContent += " <div class=\"column\" id=\"colRight\" onclick=\"onArticle("+str(cpt+1)+")\">\n"
|
|
| 89 |
- pageContent += " ⮞\n" |
|
| 90 |
- pageContent += " </div><!-- /column colRight -->\n" |
|
| 91 |
- pageContent += "</div>\n" |
|
| 92 |
- pageContent += "\n" |
|
| 93 |
- cpt += 1 |
|
| 94 |
- # ~ pageContent += "</div>\n" |
|
| 95 |
- pageContent += "</div><!-- /row -->\n" |
|
| 96 |
- return pageContent |
|
| 21 |
+ debug("Downloading: "+url)
|
|
| 22 |
+ r = requests.get(url, allow_redirects=True) |
|
| 23 |
+ content = r.text |
|
| 24 |
+ #print(r.text) |
|
| 25 |
+ lineNextChapter = None |
|
| 26 |
+ linePreviousChapter = None |
|
| 27 |
+ lineTitle = None |
|
| 28 |
+ linkNext = None |
|
| 29 |
+ linkPrev = None |
|
| 30 |
+ listImages = [] |
|
| 31 |
+ for line in content.split("\n"):
|
|
| 32 |
+ if "navi-change-chapter-btn-prev a-h" in line and linePreviousChapter is None: |
|
| 33 |
+ linePreviousChapter = line |
|
| 34 |
+ elif "navi-change-chapter-btn-next a-h" in line and lineNextChapter is None: |
|
| 35 |
+ lineNextChapter = line |
|
| 36 |
+ elif "<meta property=\"og:title\" content=\"" in line and lineTitle is None: |
|
| 37 |
+ lineTitle = line |
|
| 38 |
+ elif "<img class=\"img-loading\" data-src=\"" in line: |
|
| 39 |
+ listImages.append(line.split("\"")[3])
|
|
| 40 |
+ |
|
| 41 |
+ if 0 == len(listImages): |
|
| 42 |
+ # Attempt to extract images once more, most likely all are on one line |
|
| 43 |
+ for line in content.split("\n"):
|
|
| 44 |
+ if " page " in line: |
|
| 45 |
+ for subLine in line.split("><"):
|
|
| 46 |
+ if "https://" in subLine: |
|
| 47 |
+ listImages.append(subLine.split("\"")[1])
|
|
| 48 |
+ |
|
| 49 |
+ #say("Prev :"+str(len(linePreviousChapter)))
|
|
| 50 |
+ #say("Next :"+str(len(lineNextChapter)))
|
|
| 51 |
+ if 200 < len(lineNextChapter): |
|
| 52 |
+ tempLine = lineNextChapter |
|
| 53 |
+ lineNextChapter = None |
|
| 54 |
+ for line in tempLine.split("><"):
|
|
| 55 |
+ if "navi-change-chapter-btn-next a-h" in line and lineNextChapter is None: |
|
| 56 |
+ lineNextChapter = line |
|
| 57 |
+ linkNext=lineNextChapter.split("\"")[5]
|
|
| 58 |
+ else: |
|
| 59 |
+ linkNext="https://manganelo.tv"+lineNextChapter.split("\"")[5]
|
|
| 60 |
+ |
|
| 61 |
+ if 200 < len(linePreviousChapter): |
|
| 62 |
+ tempLine = linePreviousChapter |
|
| 63 |
+ linePreviousChapter = None |
|
| 64 |
+ for line in tempLine.split("><"):
|
|
| 65 |
+ if "navi-change-chapter-btn-prev a-h" in line and linePreviousChapter is None: |
|
| 66 |
+ linePreviousChapter = line |
|
| 67 |
+ linkPrev=linePreviousChapter.split("\"")[5]
|
|
| 68 |
+ else: |
|
| 69 |
+ linkPrev="https://manganelo.tv"+linePreviousChapter.split("\"")[5]
|
|
| 70 |
+ |
|
| 71 |
+ mangaTitle=lineTitle.split("\"")[3].split(" - Manganelo")[0]
|
|
| 72 |
+ say("Manga :"+mangaTitle)
|
|
| 73 |
+ pageContent = "" |
|
| 74 |
+ pageContent += "<div class=\"mangaChapNavig\">\n" |
|
| 75 |
+ pageContent += " <div class=\"mangaTitle\">"+mangaTitle+"</div>\n" |
|
| 76 |
+ pageContent += " <div class=\"mangaRead\" onclick=\"onArticle(0)\">📖</div>\n" |
|
| 77 |
+ if linkPrev is not None: |
|
| 78 |
+ pageContent += " <div class=\"mangaChapNavigPrev\"><a href=\"?url="+linkPrev+"\"><div class=\"arrow-left\"></div></a></div>\n" |
|
| 79 |
+ if linkNext is not None: |
|
| 80 |
+ pageContent += " <div class=\"mangaChapNavigNext\"><a href=\"?url="+linkNext+"\"><div class=\"arrow-right\"></div></a></div>\n" |
|
| 81 |
+ pageContent += " <div class=\"mangaChapNavigHome\"><a href=\".\"><div class=\"arrow-up\"></div><a></div>\n" |
|
| 82 |
+ pageContent += "</div>\n" |
|
| 83 |
+ |
|
| 84 |
+ pageContent += "<a name=\"article-top\"></a><div id=\"article-current\"></div>\n" |
|
| 85 |
+ pageContent += "<div class=\"row\">\n\n" |
|
| 86 |
+ |
|
| 87 |
+ cpt = 0 |
|
| 88 |
+ for pageImage in listImages: |
|
| 89 |
+ #debug(pageImage) |
|
| 90 |
+ pageContent += "<div class=\"article\" id=\"article-"+str(cpt)+"\" style=\"display: none;\">\n" |
|
| 91 |
+ pageContent += " <div class=\"column\" id=\"colLeft\" onclick=\"onArticle("+str(cpt-1)+")\">\n"
|
|
| 92 |
+ pageContent += " <div class=\"arrow-left\"></div>\n" |
|
| 93 |
+ pageContent += " </div><!-- /column colLeft -->\n" |
|
| 94 |
+ |
|
| 95 |
+ pageContent += " <div class=\"column\" id=\"colMiddle\">\n" |
|
| 96 |
+ pageContent += " <a name=\"article-"+str(cpt)+"\">\n" |
|
| 97 |
+ pageContent += " <img src=\"defer.png\" data-src=\""+pageImage+"\" class=\"center\">\n" |
|
| 98 |
+ #pageContent += " <li>"+str(cpt)+" : "+pageImage+"</li>\n" |
|
| 99 |
+ pageContent += " </div><!-- /column colMiddle -->\n\n" |
|
| 100 |
+ |
|
| 101 |
+ pageContent += " <div class=\"column\" id=\"colRight\" onclick=\"onArticle("+str(cpt+1)+")\">\n"
|
|
| 102 |
+ pageContent += " <div class=\"arrow-right\"></div>\n" |
|
| 103 |
+ pageContent += " </div><!-- /column colRight -->\n" |
|
| 104 |
+ pageContent += "</div>\n" |
|
| 105 |
+ pageContent += "\n" |
|
| 106 |
+ cpt += 1 |
|
| 107 |
+ |
|
| 108 |
+ pageContent += "</div><!-- /row -->\n" |
|
| 109 |
+ return pageContent |
|
| 97 | 110 |
|
| 98 | 111 |
class MyServer(BaseHTTPRequestHandler): |
| 99 | 112 |
def do_GET(self): |
| ... | ... |
@@ -2,7 +2,7 @@ html {
|
| 2 | 2 |
font-family: "Lucida Sans", sans-serif; |
| 3 | 3 |
} |
| 4 | 4 |
body,h1,h2{
|
| 5 |
- background-color:#404040; |
|
| 5 |
+ background-color:#333; |
|
| 6 | 6 |
font-family:arial,verdana,sans-serif |
| 7 | 7 |
} |
| 8 | 8 |
|
| ... | ... |
@@ -30,6 +30,7 @@ a:hover{color:#fff;background-color:#cc9630}
|
| 30 | 30 |
.mangaChapNavigNext, |
| 31 | 31 |
.mangaChapNavigHome, |
| 32 | 32 |
.mangaTitle {
|
| 33 |
+ background-color:#404040; |
|
| 33 | 34 |
font-size: 1.5em; |
| 34 | 35 |
color:#cc9630; |
| 35 | 36 |
display: inline; |
| ... | ... |
@@ -49,22 +50,43 @@ a:hover{color:#fff;background-color:#cc9630}
|
| 49 | 50 |
display: inline; |
| 50 | 51 |
} |
| 51 | 52 |
|
| 53 |
+.row {
|
|
| 54 |
+ margin-left: auto; |
|
| 55 |
+ margin-right: auto; |
|
| 56 |
+ width: 50% |
|
| 57 |
+ |
|
| 58 |
+} |
|
| 59 |
+ |
|
| 52 | 60 |
.column {
|
| 53 | 61 |
float: left; |
| 54 | 62 |
color:#cc9630; |
| 55 | 63 |
} |
| 56 | 64 |
|
| 57 | 65 |
#colLeft {
|
| 58 |
- width: 20px; |
|
| 59 |
- background-color:#999; |
|
| 66 |
+ width: 2%; |
|
| 67 |
+ background-color:#333; |
|
| 60 | 68 |
color:#cc9630; |
| 61 |
- height: 100vh; |
|
| 69 |
+ height: 78vh; |
|
| 70 |
+ z-index: -1; |
|
| 62 | 71 |
} |
| 63 | 72 |
#colRight {
|
| 64 |
- width: 20px; |
|
| 65 |
- background-color:#999; |
|
| 73 |
+ float: right; |
|
| 74 |
+ width: 2%; |
|
| 75 |
+ background-color:#333; |
|
| 66 | 76 |
color:#cc9630; |
| 67 |
- height: 100vh; |
|
| 77 |
+ height: 78vh; |
|
| 78 |
+ z-index: -1; |
|
| 79 |
+} |
|
| 80 |
+#colMiddle {
|
|
| 81 |
+ max-width: 95%; |
|
| 82 |
+ max-height: 78vh; |
|
| 83 |
+ display: inline; |
|
| 84 |
+} |
|
| 85 |
+.center {
|
|
| 86 |
+ display: block; |
|
| 87 |
+ width: 98%; |
|
| 88 |
+ margin-left: auto; |
|
| 89 |
+ margin-right: auto; |
|
| 68 | 90 |
} |
| 69 | 91 |
|
| 70 | 92 |
/* Clear floats after the columns */ |
| ... | ... |
@@ -73,3 +95,40 @@ a:hover{color:#fff;background-color:#cc9630}
|
| 73 | 95 |
display: table; |
| 74 | 96 |
clear: both; |
| 75 | 97 |
} |
| 98 |
+ |
|
| 99 |
+.mangaKey {
|
|
| 100 |
+ background-color: transparent; |
|
| 101 |
+} |
|
| 102 |
+ |
|
| 103 |
+.arrow-up, |
|
| 104 |
+.arrow-down, |
|
| 105 |
+.arrow-left, |
|
| 106 |
+.arrow-right {
|
|
| 107 |
+ width: 0; |
|
| 108 |
+ height: 0; |
|
| 109 |
+ display: inline-block; |
|
| 110 |
+} |
|
| 111 |
+ |
|
| 112 |
+.arrow-up {
|
|
| 113 |
+ border-left: 10px solid transparent; |
|
| 114 |
+ border-right: 10px solid transparent; |
|
| 115 |
+ border-bottom: 10px solid #cc9630; |
|
| 116 |
+} |
|
| 117 |
+ |
|
| 118 |
+.arrow-down {
|
|
| 119 |
+ border-left: 20px solid transparent; |
|
| 120 |
+ border-right: 20px solid transparent; |
|
| 121 |
+ border-top: 20px solid #cc9630; |
|
| 122 |
+} |
|
| 123 |
+ |
|
| 124 |
+.arrow-right {
|
|
| 125 |
+ border-top: 10px solid transparent; |
|
| 126 |
+ border-bottom: 10px solid transparent; |
|
| 127 |
+ border-left: 10px solid #cc9630; |
|
| 128 |
+} |
|
| 129 |
+ |
|
| 130 |
+.arrow-left {
|
|
| 131 |
+ border-top: 10px solid transparent; |
|
| 132 |
+ border-bottom: 10px solid transparent; |
|
| 133 |
+ border-right:10px solid #cc9630; |
|
| 134 |
+} |