Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
PKH_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
2
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
윤영빈
2020-05-31 14:13:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3887f8dc9300be7a8b4b4a163246a600c1feb210
3887f8dc
1 parent
1b4cf2a2
get youtube url from video ID
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
web/backend/yt8m/esot3ria/url_generator.py
web/backend/yt8m/esot3ria/url_generator.py
0 → 100644
View file @
3887f8d
import
requests
base_URL
=
'https://data.yt8m.org/2/j/i/'
youtube_url
=
'https://www.youtube.com/watch?v='
def
getURL
(
vid_id
):
URL
=
base_URL
+
vid_id
[:
-
2
]
+
'/'
+
vid_id
+
'.js'
response
=
requests
.
get
(
URL
,
verify
=
False
)
if
response
.
status_code
==
200
:
return
youtube_url
+
response
.
text
[
10
:
-
3
]
# example usage : getURL('nXSc');
\ No newline at end of file
Please
register
or
login
to post a comment