Python code developed for listing links to all vides on YouTube channel
- or -
Post a project like this$100
- Posted:
- Proposals: 7
- Remote
- #1373878
- PRE-FUNDED
- Expired
Full Stack Web Developer | PHP | Laravel | CodeIgniter | JavaScript | jQuery | Ajax |MySQL
Amsterdam
969507819744717351031353136100514160991475676
Description
Experience Level: Entry
General information for the business: Real estate
Description of requirements/functionality: Code to be developed in python 2.7.x. Once code is delivered we will pipe the code to another process.
Specific technologies required: python 2.7.x
Extra notes: General information for the business: Real estate
Description of requirements/functionality: We have a YouTube channel with many videos and we are adding more. I need a script (in python 2.7.x) that will list links to all the videos in our channel. The output will looks something like the following:
* [1836019 - 2132 Summer Home St](https://www.youtube.com/watch?v=34nSHZ-oTlc)
* [1829552 - 1709 British Cup Dr](https://www.youtube.com/watch?v=_w7I-ICiq88)
* [1827473 - 11009 Desert Dove Av](https://www.youtube.com/watch?v=NXJiGsMHDaw)
* [1842463 - 2546 Wind Spinner St](https://www.youtube.com/watch?v=6yMHRPnz7iI)
* [1832188 - 712 Anacapri St](https://www.youtube.com/watch?v=pSESJTbFdSw)
So, the format is one video per line in the following format: * [{title from video}]({url to video})
Below is ~code we have:
import urllib, json
def convertUnicodeToAscii(input):
if isinstance(input, dict):
return {convertUnicodeToAscii(key): convertUnicodeToAscii(value) for key, value in input.iteritems()}
elif isinstance(input, list):
return [convertUnicodeToAscii(element) for element in input]
elif isinstance(input, unicode):
return input.encode('utf-8')
else:
return input
url = "https://www.googleapis.com/youtube/v3/search?key={url}"
response = urllib.urlopen(url)
data = convertUnicodeToAscii(json.loads(response.read()))
md = []
currentDate = data['items'][0]['snippet']['publishedAt'].split('T')[0]
md.append(currentDate)
md.append('')
for i in range(0, len(data['items'])):
date = data['items'][i]['snippet']['publishedAt'].split('T')[0]
if date != currentDate:
currentDate = date
md.append('')
md.append(currentDate)
md.append('')
title = data['items'][i]['snippet']['title'].split()
title = title[0]+' - '+" ".join(title[1:])
id = data['items'][i]['snippet']['thumbnails']['default']['url'].split('/')[-2]
url = 'https://www.youtube.com/watch?v='+id
md.append('* [%s](%s)' % (title, url))
print "\n".join(md)
Specific technologies required: Python
Extra notes: We develop software ourselves but we occasionally have tasks that we do not have time for and are looking for someone with whom we can pay to handle such tasks. These are all small tasks. We use Python 2.7.s, not 3.x. Below is sample code for obtaining the first 50 but more than 50 requires OAuth with which we have no experience. We will not provide access to our channel
Description of requirements/functionality: Code to be developed in python 2.7.x. Once code is delivered we will pipe the code to another process.
Specific technologies required: python 2.7.x
Extra notes: General information for the business: Real estate
Description of requirements/functionality: We have a YouTube channel with many videos and we are adding more. I need a script (in python 2.7.x) that will list links to all the videos in our channel. The output will looks something like the following:
* [1836019 - 2132 Summer Home St](https://www.youtube.com/watch?v=34nSHZ-oTlc)
* [1829552 - 1709 British Cup Dr](https://www.youtube.com/watch?v=_w7I-ICiq88)
* [1827473 - 11009 Desert Dove Av](https://www.youtube.com/watch?v=NXJiGsMHDaw)
* [1842463 - 2546 Wind Spinner St](https://www.youtube.com/watch?v=6yMHRPnz7iI)
* [1832188 - 712 Anacapri St](https://www.youtube.com/watch?v=pSESJTbFdSw)
So, the format is one video per line in the following format: * [{title from video}]({url to video})
Below is ~code we have:
import urllib, json
def convertUnicodeToAscii(input):
if isinstance(input, dict):
return {convertUnicodeToAscii(key): convertUnicodeToAscii(value) for key, value in input.iteritems()}
elif isinstance(input, list):
return [convertUnicodeToAscii(element) for element in input]
elif isinstance(input, unicode):
return input.encode('utf-8')
else:
return input
url = "https://www.googleapis.com/youtube/v3/search?key={url}"
response = urllib.urlopen(url)
data = convertUnicodeToAscii(json.loads(response.read()))
md = []
currentDate = data['items'][0]['snippet']['publishedAt'].split('T')[0]
md.append(currentDate)
md.append('')
for i in range(0, len(data['items'])):
date = data['items'][i]['snippet']['publishedAt'].split('T')[0]
if date != currentDate:
currentDate = date
md.append('')
md.append(currentDate)
md.append('')
title = data['items'][i]['snippet']['title'].split()
title = title[0]+' - '+" ".join(title[1:])
id = data['items'][i]['snippet']['thumbnails']['default']['url'].split('/')[-2]
url = 'https://www.youtube.com/watch?v='+id
md.append('* [%s](%s)' % (title, url))
print "\n".join(md)
Specific technologies required: Python
Extra notes: We develop software ourselves but we occasionally have tasks that we do not have time for and are looking for someone with whom we can pay to handle such tasks. These are all small tasks. We use Python 2.7.s, not 3.x. Below is sample code for obtaining the first 50 but more than 50 requires OAuth with which we have no experience. We will not provide access to our channel
Eric F.
100% (1)Projects Completed
1
Freelancers worked with
1
Projects awarded
0%
Last project
2 Dec 2016
United States
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Whats wrong with the current code?
243525
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies