Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaveMyPlaylist
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
SaveMyPlaylist
Commits
c3c3e51c
Commit
c3c3e51c
authored
5 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
externalized version
parent
09f6a02d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
SaveMyPlaylist.py
+5
-12
5 additions, 12 deletions
SaveMyPlaylist.py
version.json
+7
-0
7 additions, 0 deletions
version.json
with
12 additions
and
12 deletions
SaveMyPlaylist.py
+
5
−
12
View file @
c3c3e51c
...
@@ -9,8 +9,6 @@ import googleapiclient.discovery
...
@@ -9,8 +9,6 @@ import googleapiclient.discovery
import
googleapiclient.errors
import
googleapiclient.errors
import
youtube_dl
import
youtube_dl
VERSION
=
(
2
,
0
,
0
)
def
prepare_logging
()
->
logging
.
Logger
:
def
prepare_logging
()
->
logging
.
Logger
:
LOG_FORMAT
=
'
[%(levelname)-7s] - %(asctime)s - %(message)s
'
LOG_FORMAT
=
'
[%(levelname)-7s] - %(asctime)s - %(message)s
'
...
@@ -65,7 +63,10 @@ class SaveMyPlaylist:
...
@@ -65,7 +63,10 @@ class SaveMyPlaylist:
ILLEGAL_CHARS
=
[
'
NUL
'
,
'
\'
,
''
//
'
,
'
:
'
,
'
*
'
,
'"'
,
'
<
'
,
'
>
'
,
'
|
'
]
ILLEGAL_CHARS
=
[
'
NUL
'
,
'
\'
,
''
//
'
,
'
:
'
,
'
*
'
,
'"'
,
'
<
'
,
'
>
'
,
'
|
'
]
def
__init__
(
self
,
apiKey
,
playlistId
):
def
__init__
(
self
,
apiKey
,
playlistId
):
logger
.
info
(
'
### SaveMyPlaylist v{} ###
'
.
format
(
'
.
'
.
join
(
str
(
i
)
for
i
in
VERSION
)))
with
open
(
'
version.json
'
,
'
r
'
,
encoding
=
'
utf-8
'
)
as
f
:
VERSION
=
json
.
load
(
f
)[
'
version
'
]
logger
.
info
(
'
### SaveMyPlaylist {} ###
'
.
format
(
VERSION
[
'
name
'
]))
logger
.
info
(
'
=============================
'
)
logger
.
info
(
'
=============================
'
)
self
.
_apiKey
=
apiKey
self
.
_apiKey
=
apiKey
self
.
_playlistId
=
playlistId
self
.
_playlistId
=
playlistId
...
@@ -160,17 +161,9 @@ class SaveMyPlaylist:
...
@@ -160,17 +161,9 @@ class SaveMyPlaylist:
return
fileName
return
fileName
def
run
()
:
if
__name__
==
'
__main__
'
:
with
open
(
"
config/settings.json
"
,
"
r
"
)
as
f
:
with
open
(
"
config/settings.json
"
,
"
r
"
)
as
f
:
SETTINGS
=
json
.
load
(
f
)
SETTINGS
=
json
.
load
(
f
)
saveMyPlaylist
=
SaveMyPlaylist
(
SETTINGS
[
'
apiKey
'
],
SETTINGS
[
'
playlistId
'
])
saveMyPlaylist
=
SaveMyPlaylist
(
SETTINGS
[
'
apiKey
'
],
SETTINGS
[
'
playlistId
'
])
saveMyPlaylist
.
download_items
(
SETTINGS
[
'
destinationFolder
'
],
SETTINGS
[
'
skipDownload
'
])
saveMyPlaylist
.
download_items
(
SETTINGS
[
'
destinationFolder
'
],
SETTINGS
[
'
skipDownload
'
])
if
__name__
==
'
__main__
'
:
if
len
(
sys
.
argv
)
>
1
:
if
sys
.
argv
[
1
]
==
'
--version
'
:
print
(
'
.
'
.
join
(
str
(
part
)
for
part
in
VERSION
))
else
:
run
()
This diff is collapsed.
Click to expand it.
version.json
0 → 100644
+
7
−
0
View file @
c3c3e51c
{
"version"
:
{
"name"
:
"v2.0.0"
,
"code"
:
5
,
"date"
:
"17.10.19"
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment