Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
network-assets-reptile
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
network-assets-reptile
Commits
95d2639e
Commit
95d2639e
authored
Jul 12, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:爬取youtube
parent
88e54721
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
index.py
utils/index.py
+5
-5
No files found.
utils/index.py
View file @
95d2639e
...
@@ -21,20 +21,20 @@ def convert_string_to_time(string):
...
@@ -21,20 +21,20 @@ def convert_string_to_time(string):
if
"天前"
in
string
:
if
"天前"
in
string
:
days
=
int
(
string
.
split
(
"天前"
)[
0
])
days
=
int
(
string
.
split
(
"天前"
)[
0
])
converted_time
=
current_time
-
relativ
edelta
(
days
=
days
)
converted_time
=
current_time
-
tim
edelta
(
days
=
days
)
elif
"周前"
in
string
:
elif
"周前"
in
string
:
weeks
=
int
(
string
.
split
(
"周前"
)[
0
])
weeks
=
int
(
string
.
split
(
"周前"
)[
0
])
converted_time
=
current_time
-
relativ
edelta
(
weeks
=
weeks
)
converted_time
=
current_time
-
tim
edelta
(
weeks
=
weeks
)
elif
"月前"
in
string
:
elif
"月前"
in
string
:
months
=
int
(
string
.
split
(
"月前"
)[
0
])
months
=
int
(
string
.
split
(
"月前"
)[
0
])
converted_time
=
current_time
-
relativedelta
(
months
=
months
)
converted_time
=
current_time
-
timedelta
(
days
=
months
*
30
)
elif
"年前"
in
string
:
elif
"年前"
in
string
:
years
=
int
(
string
.
split
(
"年前"
)[
0
])
years
=
int
(
string
.
split
(
"年前"
)[
0
])
converted_time
=
current_time
-
relativedelta
(
years
=
years
)
converted_time
=
current_time
-
timedelta
(
days
=
years
*
365
)
else
:
else
:
raise
ValueError
(
"Invalid string format"
)
raise
ValueError
(
"Invalid string format"
)
timestamp
=
converted_time
.
timestamp
(
)
timestamp
=
int
(
converted_time
.
timestamp
()
)
return
timestamp
return
timestamp
def
convert_to_traditional
(
simplified_text
):
def
convert_to_traditional
(
simplified_text
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment