Skip to content

Commit

Permalink
fix: only match books/chapters in playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
detvdl committed Apr 19, 2019
1 parent 27b78ba commit 45758eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions safaribooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,11 @@ def get_playlist_books(self):
self.books_dir = os.path.join(PATH, base_dir, self.escape_dirname(pdir))

ourns = [book.get("ourn") for book in response.get("content")]
ids = [re.search('urn:orm:book:([^:]*)(?::.+)', ourn).group(1) for ourn in ourns]

ids = []
for ourn in ourns:
result = re.search('urn:orm:book:([^:]*)(?::.+)', ourn)
if result:
ids.append(result.group(1))
return ids

def return_cookies(self):
Expand Down

0 comments on commit 45758eb

Please sign in to comment.