Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Conversation

@SourceryAI
Copy link

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:

git fetch https://github.com/sourcery-ai-bot/pluralsight_scrapper master
git merge --ff-only FETCH_HEAD
git reset HEAD^

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"]:
Copy link
Author

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)

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"
)

Copy link
Author

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")
Copy link
Author

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.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant