Skip to content

Commit

Permalink
Merge pull request #50 from HanaDigital/version-2.0.0
Browse files Browse the repository at this point in the history
novelfull fix
  • Loading branch information
dr-nyt authored Nov 20, 2020
2 parents 3c396c1 + 7a6cbfb commit 57e995c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "novelscraper",
"version": "2.0.1",
"version": "2.0.2",
"description": "App for downloading novels from pirate sites.",
"homepage": "https://github.com/HanaDigital/NovelScraper",
"author": {
Expand Down
9 changes: 5 additions & 4 deletions src/app/services/sources/novelfull.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export class NovelfullService extends sourceService {
novel.latestChapter = html.getElementsByClassName('l-chapter')[0].getElementsByTagName('a')[0].title;

// FIXME: Cover
novel.cover = html.getElementsByClassName('book')[0].getElementsByTagName('img')[0].src.replace('localhost:4200', 'novelfull.com');
novel.cover = "https://novelfull.com" + html.getElementsByClassName('book')[0].getElementsByTagName('img')[0].getAttribute('src');
console.log(novel.cover)

// FIXME: TotalChapters
const lastPage = parseInt(html.getElementsByClassName('pagination')[0].getElementsByClassName('last')[0].getElementsByTagName('a')[0].getAttribute('data-page'));
Expand Down Expand Up @@ -128,7 +129,8 @@ export class NovelfullService extends sourceService {
//////////////////////// [3] YOUR CODE STARTS HERE ///////////////////////////////
console.log(novelList[i])
// FIXME: Link
novel.link = novelList[i].getElementsByClassName('truyen-title')[0].getElementsByTagName('a')[0].href.replace(/http:\/\/localhost:\d+/g, 'https://novelfull.com');
novel.link = "https://novelfull.com" + novelList[i].getElementsByClassName('truyen-title')[0].getElementsByTagName('a')[0].getAttribute('href');
console.log(novel.link)

// FIXME: Name
novel.name = novelList[i].getElementsByClassName('truyen-title')[0].getElementsByTagName('a')[0].innerText;
Expand All @@ -137,8 +139,7 @@ export class NovelfullService extends sourceService {
novel.latestChapter = novelList[i].getElementsByClassName('chapter-text')[0].textContent;

// FIXME: Cover
novel.cover = novelList[i].getElementsByTagName('img')[0].src.replace('localhost:4200', 'novelfull.com');
console.log(novel.cover);
novel.cover = "https://novelfull.com/" + novelList[i].getElementsByTagName('img')[0].getAttribute('src');

// FIXME: TotalChapters
novel.totalChapters = 0; // If totalChapters is unknown, set it to 0 as it will not accept a string
Expand Down

0 comments on commit 57e995c

Please sign in to comment.