-
Notifications
You must be signed in to change notification settings - Fork 3
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 refactored master branch #6
base: master
Are you sure you want to change the base?
Conversation
print("File" + str(i) + "=" + "http://riitube.rc24.xyz/video/wii/?q=" + entry["videoId"]) | ||
print("Title" + str(i) + "=" + entry["title"]) | ||
print("Length" + str(i) + "=" + str(entry["lengthSeconds"])) | ||
print(f"File{str(i)}=http://riitube.rc24.xyz/video/wii/?q=" + entry["videoId"]) | ||
print(f"Title{str(i)}=" + entry["title"]) | ||
print(f"Length{str(i)}=" + str(entry["lengthSeconds"])) |
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.
Lines 25-27
refactored with the following changes:
- Use f-string instead of string concatenation [×7] (
use-fstring-for-concatenation
)
i = 1 | ||
|
||
for entry in api: | ||
print("File" + str(i) + "=" + "http://riitube.rc24.xyz/video/wii/?q=" + entry["id"] + "&site=dailymotion".replace("https://dailymotion.com/", "")) | ||
print("Title" + str(i) + "=" + entry["title"]) | ||
print("Length" + str(i) + "=" + str(0)) | ||
|
||
i += 1 | ||
for i, entry in enumerate(api, start=1): | ||
print( | ||
f"File{str(i)}=http://riitube.rc24.xyz/video/wii/?q=" | ||
+ entry["id"] | ||
+ "&site=dailymotion".replace("https://dailymotion.com/", "") | ||
) | ||
print(f"Title{str(i)}=" + entry["title"]) | ||
print(f"Length{str(i)}=0") |
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.
Lines 15-22
refactored with the following changes:
- Replace manual loop counter with call to enumerate (
convert-to-enumerate
) - Use f-string instead of string concatenation [×8] (
use-fstring-for-concatenation
) - Remove unnecessary calls to
str()
from formatted values in f-strings (remove-str-from-fstring
) - Simplify unnecessary nesting, casting and constant values in f-strings (
simplify-fstring-formatting
)
i = 1 | ||
|
||
for entry in playlist: | ||
print("File" + str(i) + "=" + "http://riitube.rc24.xyz/video/wii/?q=" + urllib.parse.quote(playlist[entry]) + "&site=iptv") | ||
print("Title" + str(i) + "=" + entry.decode()) | ||
print("Length" + str(i) + "=" + "9999999") | ||
|
||
i += 1 | ||
for i, (entry, value) in enumerate(playlist.items(), start=1): | ||
print( | ||
f"File{str(i)}=http://riitube.rc24.xyz/video/wii/?q={urllib.parse.quote(value)}&site=iptv" | ||
) | ||
print(f"Title{str(i)}={entry.decode()}") | ||
print(f"Length{str(i)}=9999999") |
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.
Lines 31-38
refactored with the following changes:
- Use items() to directly unpack dictionary values (
use-dict-items
) - Replace manual loop counter with call to enumerate (
convert-to-enumerate
) - Use f-string instead of string concatenation [×11] (
use-fstring-for-concatenation
)
i = 1 | ||
|
||
for entry in api: | ||
print("File" + str(i) + "=" + "http://riitube.rc24.xyz/video/wii/?q=" + entry["link"].replace("https://vimeo.com/", "") + "&site=vimeo") | ||
print("Title" + str(i) + "=" + entry["name"]) | ||
print("Length" + str(i) + "=" + str(entry["duration"])) | ||
|
||
i += 1 | ||
for i, entry in enumerate(api, start=1): | ||
print( | ||
f"File{str(i)}=http://riitube.rc24.xyz/video/wii/?q=" | ||
+ entry["link"].replace("https://vimeo.com/", "") | ||
+ "&site=vimeo" | ||
) | ||
print(f"Title{str(i)}=" + entry["name"]) | ||
print(f"Length{str(i)}=" + str(entry["duration"])) |
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.
Lines 19-26
refactored with the following changes:
- Replace manual loop counter with call to enumerate (
convert-to-enumerate
) - Use f-string instead of string concatenation [×7] (
use-fstring-for-concatenation
)
Branch
master
refactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run:Help us improve this pull request!