This repository was archived by the owner on Apr 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Sourcery Starbot ⭐ refactored Stormix/pluralsight_scrapper #7
Open
SourceryAI
wants to merge
1
commit into
Stormix:master
Choose a base branch
from
SourceryAI:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SourceryAI
commented
Sep 6, 2020
| currentfolder = os.path.dirname(os.path.abspath(inspect.stack()[0][1])) | ||
| # Check which operating system is being used ! | ||
| if platform == "linux" or platform == "linux2": | ||
| if platform in ["linux", "linux2"]: |
Author
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
inoperator (merge-comparisons)
Comment on lines
-103
to
+123
| 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" | ||
| ) | ||
|
|
Author
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)
Comment on lines
-122
to
+135
| link = video_elt.get_attribute("src") | ||
| return link | ||
| return video_elt.get_attribute("src") |
Author
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)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
masterbranch, then run: