-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sourcery Starbot ⭐ refactored Stormix/pluralsight_scrapper #7
base: master
Are you sure you want to change the base?
Conversation
if platform == "linux" or platform == "linux2": | ||
if platform in ["linux", "linux2"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function PluralCourse.launchBrowser
refactored with the following changes:
- Replace multiple comparisons of same variable with
in
operator (merge-comparisons
)
for j in range(len(ModuleEpisodesList)): | ||
self.createDir(self.output+"/"+slugify(ModuleTitles[i])+"/"+slugify(ModuleEpisodesList[j])) | ||
for item in ModuleEpisodesList: | ||
self.createDir(self.output+"/"+slugify(ModuleTitles[i])+"/" + slugify(item)) | ||
# Get the episode elemnt | ||
self.browser.find_element_by_xpath("//*[contains(text(), '"+ModuleEpisodesList[j]+"')]").click() | ||
self.browser.find_element_by_xpath( | ||
"//*[contains(text(), '" + item + "')]" | ||
).click() | ||
|
||
time.sleep(self.delay*1.5) | ||
self.pausePlayback() | ||
print("Downloading : ",slugify(ModuleEpisodesList[j])+".mp4") | ||
path =self.output+"/"+slugify(ModuleTitles[i])+"/"+slugify(ModuleEpisodesList[j])+"/"+slugify(ModuleEpisodesList[j])+".mp4" | ||
print("Downloading : ", slugify(item) + ".mp4") | ||
path = ( | ||
self.output | ||
+ "/" | ||
+ slugify(ModuleTitles[i]) | ||
+ "/" | ||
+ slugify(item) | ||
+ "/" | ||
+ slugify(item) | ||
+ ".mp4" | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function PluralCourse.downloadEpisodes
refactored with the following changes:
- Replace index in for loop with direct reference (
for-index-replacement
)
link = video_elt.get_attribute("src") | ||
return link | ||
return video_elt.get_attribute("src") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function PluralCourse.getVideoLink
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run: