Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 06-02-2017, 09:58 AM   #2146
Atherton25
Zealot
Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.
 
Posts: 124
Karma: 3804
Join Date: May 2016
Device: Kindle Oasis 2
That's a user ID, not a storyID. Note the /u/ not /s/. It can easily be adjusted to pull one (or both) but you really don't want to extract a userID into a storyID column.

But, for your specific question/request:
(.*?) href="http(s?)://www.fanfiction.net/u/(.*?)/(?s).*
-or-
([\s\S]*) href="http(s?)://www.fanfiction.net/u/(.*?)/([\s\S]*)
will isolate and pull out the ID you're looking for.

Change /u/ to /s/ if you want only story ID's. The matching item is: \3 for the "replace with" box.

It's possible to do:
(.*?) href="http(s?)://www.fanfiction.net/(u|s)/(.*?)/(?s).*
-or-
([\s\S]*) href="http(s?)://www.fanfiction.net/(u|s)/(.*?)/([\s\S]*)
and use \4 - but keep in mind by doing this you're not distinguishing between what type of ID it is, so I would avoid that unless you have a specific reason for it.

NOTE: edited above string from initial post, to allow for additional lines of text Not sure what the before/after text looks like, but that should take care of anything else.

Anything newer seems to be HTTPS on ff.net, but I have a lot of older stuff, so I always use the http(s?) function to ensure that anything that's http:// is captured as well.

Last edited by Atherton25; 06-02-2017 at 10:20 AM. Reason: modified regex, added another string too.
Atherton25 is offline   Reply With Quote
Old 06-02-2017, 10:36 AM   #2147
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
Maybe it's just me but I just tried what you posted and can't get it to work.
Tanjamuse is offline   Reply With Quote
Advert
Old 06-02-2017, 10:41 AM   #2148
Atherton25
Zealot
Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.
 
Posts: 124
Karma: 3804
Join Date: May 2016
Device: Kindle Oasis 2
Give me a little more info. What column are you pulling from, and what's an example of the entire text there? I had assumed that it was comments, and so I did a test, then I added some lines and saw that new lines broke it, that's why I edited and adjusted the regex to include other lines. If you didn't see the edit, please try those before getting back to me.
Atherton25 is offline   Reply With Quote
Old 06-02-2017, 10:44 AM   #2149
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,973
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Atherton25 View Post
@gcomyn (and JimmXinu too I suppose)

webnovel.com made some changes to the ToC today (or late last night) and no longer is functioning. I thought I'd drop that info. I'm reading a pretty long book so I'm not in any rush to get updates personally, but I doubt I'll be the only one that'll notice.
It's also been reported in github.

GComyn should have been notified about the issue already. I'll look into in a few days if they don't respond.

Remind me if gets to be more than a week.
JimmXinu is offline   Reply With Quote
Old 06-02-2017, 10:51 AM   #2150
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
I'm pulling the information from a comments column with sideheader.

The html-part is only visible in the HTML version of the column, like this:

Code:
<a class="titlelink" href="https://www.fanfiction.net/s/12513078/1/">cape is good</a>
When it's in normal mode it only shows cape is good but in a clickable link.
Tanjamuse is offline   Reply With Quote
Advert
Old 06-02-2017, 11:06 AM   #2151
Atherton25
Zealot
Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.
 
Posts: 124
Karma: 3804
Join Date: May 2016
Device: Kindle Oasis 2
Er, I forgot to mention this - I thought about it when I was writing the expression (not the post) and forgot to mention it in the post. There is one (possibly) problem with the comments section. I'm not sure exactly how it works, but basically, it goes like this, if you've never edited the comments, then it doesn't get stored (locally?) in the database.

EDIT:Is this a custom column? I can try and duplicate it if you give me the column name/settings. Also, I have no idea what sideheader is?

It basically means that in order for the regex to work and for calibre S&R to find the HTML, you have to have first opened up the HTML source side of the comment and (maybe) edited it. I've never experimented with it myself, but I know I had problems in the past and happened across the thread semi-recently (within the last few weeks) while I was exploring the forums. I read it, stored it in my long-term memory and most of it's a haze beyond knowing that's what the problem was. I haven't spent the time to experiment and find out how to 'fix' the issue.

Found it.

Try editing the comment in plain text, see if that works, if it doesn't try editing in the HTML source (add a space or something to either). If it doesn't work after that I don't know what to tell you.

As for mass S&R? possibly doing a S&R replacing ' ' (space) with ' ' (two spaces) might modify and store the HTML locally. I really don't know how it all works and haven't sat down to see what will affect it.

Last edited by Atherton25; 06-02-2017 at 11:15 AM.
Atherton25 is offline   Reply With Quote
Old 06-02-2017, 11:16 AM   #2152
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
When I select multiple stories I can only edit the comments columns in S&R. The screenshot shows how it looks when I choose my Author_URL column.

Yes, it's a custom column, see the second screenshot. The Story URL column I have is the same except of course for the name of it. I have the following in my personal.ini.

Code:
    authorHTML=>#author_url
    titleHTML=>#story_url
Attached Thumbnails
Click image for larger version

Name:	Skærmbillede 2017-06-02 17.10.32.png
Views:	239
Size:	62.4 KB
ID:	157145   Click image for larger version

Name:	Author URL.png
Views:	219
Size:	28.1 KB
ID:	157146  
Tanjamuse is offline   Reply With Quote
Old 06-02-2017, 11:46 AM   #2153
Atherton25
Zealot
Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.
 
Posts: 124
Karma: 3804
Join Date: May 2016
Device: Kindle Oasis 2
Alright, I grabbed a brand new ff.net story in my test database, with those two extra columns. I'm not sure why the initial expression didn't work, but with a few adjustments, I got something that does.

Removing the quotes IE, no extra spaces especially at the end since that'll screw up the regex:
Code:
"(.*?)http(s?)://www.fanfiction.net/u/(.*?)/(?s).*" 
-or- 
"([\s\S]*)http(s?)://www.fanfiction.net/u/(.*?)/([\s\S]*)"
both work fine for me with everything you specified.
Search mode: regex,
search field: #author_url
Search for: (either above option)
Replace with:\3
Destination field: (your choice)

Keep in mind to change /u/ and /s/ for whichever you're using.
Note: I didn't try it with the title (storyID) since it didn't download for some reason and since the author one works fine, I'm assuming the title one will too. If not I'll go back and figure it out.
Nevermind, checked and it works.

Also, I'd like to add if you weren't aware,
" storyId=>#id"
that's an easier way to keep the story ID number in a custom column (#id in my case) for newly downloaded (or updated) fics. I don't think there's one for author ID though.

Last edited by Atherton25; 06-02-2017 at 11:55 AM.
Atherton25 is offline   Reply With Quote
Old 06-02-2017, 11:55 AM   #2154
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
Thanks so much. It works fine with both story and author URL.
Tanjamuse is offline   Reply With Quote
Old 06-02-2017, 12:00 PM   #2155
Atherton25
Zealot
Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.Atherton25 can teach chickens to fly.
 
Posts: 124
Karma: 3804
Join Date: May 2016
Device: Kindle Oasis 2
No problem. I've dabbled in regex off and on, generally in calibre, my renaming program and mp3tag. While it's not super complicated sometimes it's annoying to work with. Though, when it does finally work, it does wonders for getting what you want.
Atherton25 is offline   Reply With Quote
Old 06-02-2017, 05:41 PM   #2156
BaldTrout
Junior Member
BaldTrout began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2017
Device: none
Quote:
Originally Posted by JimmXinu View Post
New test version posted

2017-05-31
- Reduce debug output from replace_br_with_p.
- Apply minimum_threadmarks in base_xenforoforum based on all threadmarks, not marks per category.
- Change AO3 to https, normalize chapter URLs, remove view_adult from chapter URLs.
- Update translations.
Thank you for adding https support for AO3
BaldTrout is offline   Reply With Quote
Old 06-04-2017, 06:39 PM   #2157
bugstomper
Member
bugstomper began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jun 2017
Device: kindle
Exclamation

royalroadl has stopped working, both in plugin and cli. Here is what the cli output looks like, tried it on two different books with identical results:

Quote:
$ fanficfare http://royalroadl.com/fiction/10286
Traceback (most recent call last):
File "/usr/local/bin/fanficfare", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/fanficfare/cli.py", line 240, in main
passed_personalini)
File "/usr/local/lib/python2.7/site-packages/fanficfare/cli.py", line 330, in do_download
adapter.getStoryMetadataOnly()
File "/usr/local/lib/python2.7/site-packages/fanficfare/adapters/base_adapter.py", line 197, in getStoryMetadataOnly
self.doExtractChapterUrlsAndMetadata(get_cover=get _cover)
File "/usr/local/lib/python2.7/site-packages/fanficfare/adapters/base_adapter.py", line 280, in doExtractChapterUrlsAndMetadata
return self.extractChapterUrlsAndMetadata()
File "/usr/local/lib/python2.7/site-packages/fanficfare/adapters/adapter_royalroadl.py", line 155, in extractChapterUrlsAndMetadata
genre=[tag.text for tag in soup.find('input',{'property':'genre'}).parent.fin dChildren('span')]
AttributeError: 'NoneType' object has no attribute 'parent'
bugstomper is offline   Reply With Quote
Old 06-04-2017, 06:40 PM   #2158
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,973
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by bugstomper View Post
royalroadl has stopped working, both in plugin and cli. Here is what the cli output looks like, tried it on two different books with identical results:
Already reported and fixed. Will be in the next test version.
JimmXinu is offline   Reply With Quote
Old 06-04-2017, 06:54 PM   #2159
bugstomper
Member
bugstomper began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jun 2017
Device: kindle
Quote:
Originally Posted by JimmXinu View Post
Already reported and fixed. Will be in the next test version.
Cool, I updated my cli version directly from git and that works. That was fast work!
bugstomper is offline   Reply With Quote
Old 06-04-2017, 11:02 PM   #2160
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,973
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
New test version posted

2017-06-04
- Fix for RoyalRoadL adapter - thanks, cryzed!
- Update translations.
JimmXinu is offline   Reply With Quote
Reply

Tags
fanfiction


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 523 07-15-2025 06:45 PM
[GUI Plugin] Open With kiwidude Plugins 404 02-21-2025 05:42 AM
[GUI Plugin] Marvin XD Philantrop Plugins 126 01-29-2017 12:48 PM
[GUI Plugin] KiNotes -axel- Plugins 0 07-14-2013 06:39 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 09:36 AM.


MobileRead.com is a privately owned, operated and funded community.