Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
USDB Downloader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
FSR VI
FSR Projekte
USDB Downloader
Commits
3edae900
Commit
3edae900
authored
2 years ago
by
TheJoKlLa
Browse files
Options
Downloads
Patches
Plain Diff
Added more complete songs
parent
e3dffea7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
USDB.xlsx
+0
-0
0 additions, 0 deletions
USDB.xlsx
main.py
+8
-7
8 additions, 7 deletions
main.py
txtdownloader.py
+5
-5
5 additions, 5 deletions
txtdownloader.py
usdb.py
+14
-3
14 additions, 3 deletions
usdb.py
with
27 additions
and
15 deletions
USDB.xlsx
+
0
−
0
View file @
3edae900
No preview for this file type
This diff is collapsed.
Click to expand it.
main.py
+
8
−
7
View file @
3edae900
...
@@ -15,8 +15,9 @@ SESSION = "ies6q9otiqktbo1ohc0d1nfhn3"
...
@@ -15,8 +15,9 @@ SESSION = "ies6q9otiqktbo1ohc0d1nfhn3"
@click.option
(
"
--force-build
"
,
is_flag
=
True
,
default
=
False
)
@click.option
(
"
--force-build
"
,
is_flag
=
True
,
default
=
False
)
@click.option
(
"
--force-download
"
,
is_flag
=
True
,
default
=
False
)
@click.option
(
"
--force-download
"
,
is_flag
=
True
,
default
=
False
)
@click.option
(
"
--only-complete
"
,
is_flag
=
True
,
default
=
False
)
@click.option
(
"
--only-complete
"
,
is_flag
=
True
,
default
=
False
)
@click.option
(
"
--only-not-complete
"
,
is_flag
=
True
,
default
=
False
)
@click.option
(
"
--skip-not-buildable
"
,
is_flag
=
True
,
default
=
False
)
@click.option
(
"
--skip-not-buildable
"
,
is_flag
=
True
,
default
=
False
)
def
main
(
action
,
debug
,
db
,
cache
,
out
,
session
,
force_build
,
force_download
,
only_complete
,
skip_not_buildable
):
def
main
(
action
,
debug
,
db
,
cache
,
out
,
session
,
force_build
,
force_download
,
only_complete
,
only_not_complete
,
skip_not_buildable
):
"""
ACTION: check|download|build|all
"""
"""
ACTION: check|download|build|all
"""
#DEBUG
#DEBUG
#force_build = True
#force_build = True
...
@@ -27,15 +28,15 @@ def main(action, debug, db, cache, out, session, force_build, force_download, on
...
@@ -27,15 +28,15 @@ def main(action, debug, db, cache, out, session, force_build, force_download, on
usdb
=
USDB
(
db
=
db
,
cache
=
cache
,
out
=
out
,
session
=
session
,
force_build
=
force_build
,
force_download
=
force_download
,
skip_not_buildable
=
skip_not_buildable
)
usdb
=
USDB
(
db
=
db
,
cache
=
cache
,
out
=
out
,
session
=
session
,
force_build
=
force_build
,
force_download
=
force_download
,
skip_not_buildable
=
skip_not_buildable
)
if
action
==
"
check
"
:
if
action
==
"
check
"
:
usdb
.
check
(
only_complete
)
usdb
.
check
(
only_complete
=
only_complete
,
only_not_complete
=
only_not_complete
)
elif
action
==
"
download
"
:
elif
action
==
"
download
"
:
usdb
.
download
(
only_complete
)
usdb
.
download
(
only_complete
=
only_complete
,
only_not_complete
=
only_not_complete
)
elif
action
==
"
build
"
:
elif
action
==
"
build
"
:
usdb
.
build
(
only_complete
)
usdb
.
build
(
only_complete
=
only_complete
,
only_not_complete
=
only_not_complete
)
else
:
else
:
usdb
.
check
(
only_complete
)
usdb
.
check
(
only_complete
=
only_complete
,
only_not_complete
=
only_not_complete
)
usdb
.
download
(
only_complete
)
usdb
.
download
(
only_complete
=
only_complete
,
only_not_complete
=
only_not_complete
)
usdb
.
build
(
only_complete
)
usdb
.
build
(
only_complete
=
only_complete
,
only_not_complete
=
only_not_complete
)
def
setup_log
(
debug
):
def
setup_log
(
debug
):
if
debug
:
if
debug
:
...
...
This diff is collapsed.
Click to expand it.
txtdownloader.py
+
5
−
5
View file @
3edae900
...
@@ -44,19 +44,19 @@ class TXTDownloader:
...
@@ -44,19 +44,19 @@ class TXTDownloader:
txt
.
artist
=
song
.
artist_name
txt
.
artist
=
song
.
artist_name
txt
.
title
=
song
.
track_name
txt
.
title
=
song
.
track_name
if
not
(
type
(
song
.
gap
)
==
float
and
str
(
song
.
gap
)
==
"
nan
"
)
:
if
song
.
gap
!=
None
:
txt
.
gap
=
song
.
gap
txt
.
gap
=
song
.
gap
if
not
(
type
(
song
.
video_gap
)
==
float
and
str
(
song
.
video_gap
)
==
"
nan
"
)
:
if
song
.
video_gap
!=
None
:
txt
.
videogap
=
song
.
video_gap
txt
.
videogap
=
song
.
video_gap
if
not
(
type
(
song
.
start
)
==
float
and
str
(
song
.
start
)
==
"
nan
"
)
:
if
song
.
start
!=
None
:
txt
.
start
=
song
.
start
txt
.
start
=
song
.
start
if
not
(
type
(
song
.
gap
)
==
float
and
str
(
song
.
gap
)
==
"
nan
"
)
:
if
song
.
gap
!=
None
:
txt
.
end
=
song
.
end
txt
.
end
=
song
.
end
if
not
(
type
(
song
.
gap
)
==
float
and
str
(
song
.
gap
)
==
"
nan
"
)
:
if
song
.
language
!=
None
:
txt
.
language
=
song
.
language
txt
.
language
=
song
.
language
if
song
.
release_date
!=
datetime
.
date
.
min
:
if
song
.
release_date
!=
datetime
.
date
.
min
:
...
...
This diff is collapsed.
Click to expand it.
usdb.py
+
14
−
3
View file @
3edae900
...
@@ -34,16 +34,19 @@ class USDB:
...
@@ -34,16 +34,19 @@ class USDB:
self
.
cache
=
cache
self
.
cache
=
cache
self
.
out
=
out
self
.
out
=
out
def
check
(
self
,
only_complete
):
def
check
(
self
,
only_complete
:
bool
,
only_not_complete
:
bool
):
for
song
in
self
.
songs
:
for
song
in
self
.
songs
:
if
only_complete
and
not
song
.
isComplete
():
if
only_complete
and
not
song
.
isComplete
():
continue
continue
if
only_not_complete
and
song
.
isComplete
():
continue
valid
,
errors
=
song
.
isValid
()
valid
,
errors
=
song
.
isValid
()
if
not
valid
:
if
not
valid
:
logging
.
error
(
f
"
USDB Entry is invalid (
{
song
.
uri
}
):
{
song
.
artist_name
}
-
{
song
.
track_name
}
--- Errors
{
'
,
'
.
join
(
errors
)
}
"
)
logging
.
error
(
f
"
USDB Entry is invalid (
{
song
.
uri
}
):
{
song
.
artist_name
}
-
{
song
.
track_name
}
--- Errors
{
'
,
'
.
join
(
errors
)
}
"
)
def
download
(
self
,
only_complete
):
def
download
(
self
,
only_complete
:
bool
,
only_not_complete
:
bool
):
if
self
.
session
==
None
:
if
self
.
session
==
None
:
logging
.
fatal
(
"
Session key is missing
"
)
logging
.
fatal
(
"
Session key is missing
"
)
...
@@ -56,6 +59,8 @@ class USDB:
...
@@ -56,6 +59,8 @@ class USDB:
for
song
in
self
.
songs
:
for
song
in
self
.
songs
:
if
only_complete
and
not
song
.
isComplete
():
if
only_complete
and
not
song
.
isComplete
():
continue
continue
if
only_not_complete
and
song
.
isComplete
():
continue
vaild
,
errors
=
song
.
isBuildable
()
vaild
,
errors
=
song
.
isBuildable
()
if
vaild
:
if
vaild
:
...
@@ -84,13 +89,15 @@ class USDB:
...
@@ -84,13 +89,15 @@ class USDB:
except
Exception
as
e
:
except
Exception
as
e
:
logging
.
exception
(
f
"
Downloading failed:
{
song
.
artist_name
}
-
{
song
.
track_name
}
"
)
logging
.
exception
(
f
"
Downloading failed:
{
song
.
artist_name
}
-
{
song
.
track_name
}
"
)
def
build
(
self
,
only_complete
):
def
build
(
self
,
only_complete
:
bool
,
only_not_complete
:
bool
):
if
self
.
force_build
:
if
self
.
force_build
:
shutil
.
rmtree
(
self
.
out
,
ignore_errors
=
True
)
shutil
.
rmtree
(
self
.
out
,
ignore_errors
=
True
)
for
song
in
self
.
songs
:
for
song
in
self
.
songs
:
if
only_complete
and
not
song
.
isComplete
():
if
only_complete
and
not
song
.
isComplete
():
continue
continue
if
only_not_complete
and
song
.
isComplete
():
continue
vaild
,
errors
=
song
.
isBuildable
()
vaild
,
errors
=
song
.
isBuildable
()
if
vaild
:
if
vaild
:
...
@@ -118,6 +125,10 @@ class USDB:
...
@@ -118,6 +125,10 @@ class USDB:
if
(
Path
(
self
.
cache
)
/
"
audio
"
/
f
"
{
song
.
getFileName_Hash_MP3
()
}
.mp3
"
).
is_file
():
if
(
Path
(
self
.
cache
)
/
"
audio
"
/
f
"
{
song
.
getFileName_Hash_MP3
()
}
.mp3
"
).
is_file
():
shutil
.
copy2
(
Path
(
self
.
cache
)
/
"
audio
"
/
f
"
{
song
.
getFileName_Hash_MP3
()
}
.mp3
"
,
new_path
/
f
"
{
song
.
getFileName
()
}
.mp3
"
)
shutil
.
copy2
(
Path
(
self
.
cache
)
/
"
audio
"
/
f
"
{
song
.
getFileName_Hash_MP3
()
}
.mp3
"
,
new_path
/
f
"
{
song
.
getFileName
()
}
.mp3
"
)
else
:
logging
.
error
(
f
"
Download is missing (
{
song
.
uri
}
):
{
song
.
artist_name
}
-
{
song
.
track_name
}
--- MP3
"
)
return
if
song
.
video_link
!=
None
and
(
Path
(
self
.
cache
)
/
"
video
"
/
f
"
{
song
.
getFileName_Hash_Video
()
}
.mp4
"
).
is_file
():
if
song
.
video_link
!=
None
and
(
Path
(
self
.
cache
)
/
"
video
"
/
f
"
{
song
.
getFileName_Hash_Video
()
}
.mp4
"
).
is_file
():
shutil
.
copy2
(
Path
(
self
.
cache
)
/
"
video
"
/
f
"
{
song
.
getFileName_Hash_Video
()
}
.mp4
"
,
new_path
/
f
"
{
song
.
getFileName
()
}
.mp4
"
)
shutil
.
copy2
(
Path
(
self
.
cache
)
/
"
video
"
/
f
"
{
song
.
getFileName_Hash_Video
()
}
.mp4
"
,
new_path
/
f
"
{
song
.
getFileName
()
}
.mp4
"
)
if
song
.
cover_link
!=
None
and
(
Path
(
self
.
cache
)
/
"
covers
"
/
f
"
{
song
.
getFileName_Hash_Cover
()
}
.jpg
"
).
is_file
():
if
song
.
cover_link
!=
None
and
(
Path
(
self
.
cache
)
/
"
covers
"
/
f
"
{
song
.
getFileName_Hash_Cover
()
}
.jpg
"
).
is_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