Comments (9)
Some books have the same short book name on safaribooks.
from safaribooks.
I fixed this issue! Thanks again!
But I don't understand the last comment. What do you mean?
from safaribooks.
Some books have the same short book name on safaribooks.
For example,the following two books have the same short name: Stepping Up
https://www.safaribooksonline.com/library/view/stepping-up/9781292186887/
https://www.safaribooksonline.com/library/view/stepping-up/9781609940584/
from safaribooks.
Ok, with the last commit I fixed this problem.
Thanks for helping me!
from safaribooks.
def escape_dirname(dirname, clean_space=False):
if ":" in dirname:
if dirname.index(":") > 30:
dirname = dirname.split(":")[0]
for ch in ['\\', '/', '<', '>', '`', '\'', '"', '*', '?', '|']:
if ch in dirname:
dirname = dirname.replace(ch, "")
return dirname if not clean_space else dirname.replace(" ", "")
this Statement maybe wrong,not 30 but 0
if dirname.index(":") > 30:
from safaribooks.
I voluntarily put 30 because I want to split only long titles.
Example: there is a book called "HTTP: The Definitive Guide". It's ok for me to display all the book title.
But I can't say the same for a book like "Windows Internals, Part 1: System architecture, processes, threads, memory management, and more, Seventh Edition".
Maybe I have to reduce the range...
from safaribooks.
Now is 15 chars
from safaribooks.
def escape_dirname(dirname, clean_space=False):
if ":" in dirname and dirname.index(":") > 15:
dirname = dirname.split(":")[0]
for ch in ['\\', '/', '<', '>', '`', '\'', '"', '*', '?', '|']:
if ch in dirname:
dirname = dirname.replace(ch, "")
return dirname if not clean_space else dirname.replace(" ", "")
Running on Windows system, dirname cannot include ":“.
for ch in ['\', '/', '<', '>', '`', ''', '"', '*', '?', '|', ':']:
if ch in dirname:
dirname = dirname.replace(ch, "")
from safaribooks.
I always use Linux, so I don't cover well the problems on Windows.
I updated the program adding this fix.
from safaribooks.
Related Issues (20)
- Downloading from public library providing Oreilly subscription HOT 1
- Images from books are corrupt HOT 3
- Auth Failure. - Unexpected error! HOT 3
- flask3.9 ImportError: cannot import name 'escape' from 'jinja2' HOT 1
- Authentication issue: unable to access profile page. HOT 8
- Cannot sudo rm -rf some .log file so cannot download my book HOT 1
- Parser: book content's corrupted or not present: ch01.xhtml
- Unhandled Exception: 'rights' (type: KeyError) HOT 1
- Trial account not working due to email issue HOT 2
- Error trying to parse this page
- SSO, Company, University, etc., Login Problems: *READ BEFORE NEW ISSUE* HOT 1
- Crawler: error trying to parse this page: c02.xhtml HOT 5
- Every chapter only has first page HOT 1
- Parser: book content's corrupted or not present
- download all books in specific playlist
- Is it normal normal that the program can't login after 10 minutes? HOT 23
- Table titles appear vertically HOT 1
- Stuck at login HOT 1
- 'Connection aborted.', RemoteDisconnected('Remote end closed connection without response') HOT 1
- Still being maintained? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from safaribooks.