This commit is contained in:
deathbybandaid 2020-12-15 11:02:07 -05:00
parent 0bd569286b
commit 7f10f45cda

View File

@ -1,5 +1,7 @@
import m3u8
import base64
class OriginChannels():
@ -21,7 +23,13 @@ class OriginChannels():
chan_list_urlopn = self.fhdhr.web.session.get(chan_list_url)
stirr_chan_list = chan_list_urlopn.json()
image_url = stirr_chan_list["channel"][0]["icon"]["src"].split("?")[0]
image_file = self.fhdhr.web.session.get(image_url).content
image_text = base64.b64encode(image_file.read())
print(image_text)
channel_list = []
return channel_list
for channel_dict in stirr_chan_list["channel"]:
chan_item_url = "%s/status/%s" % (self.base_api_url, str(channel_dict["id"]))
@ -69,127 +77,3 @@ class OriginChannels():
return bestStream.absolute_uri
else:
return m3u8_url
"""
{
'rss': {
'xmlns:sinclair': 'sinclair',
'xmlns:media': 'http://search.yahoo.com/mrss/',
'channel': {
'item': {
'link': 'https://dai.google.com/linear/hls/event/4aD5IJf0QgKUJwPbq2fngg/master.m3u8',
'category': 'OTTFeed',
'guid': {
'isPermaLink': 'false',
'content': '0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf'
},
'pubDate': '2020-12-15T09:42:17+00:00',
'media:content': {
'sinclair:ad_preroll': 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&iu=/4756/OTT_Gateway/TC&vpos=preroll&url=http%3A%2F%2Fstirr-mrss-adapter.sinclairstoryline.com%2Fapi%2Frest%2Fv3%2Fstatus%2F0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf&description_url=http%3A%2F%2Fstirr-mrss-adapter.sinclairstoryline.com%2Fapi%2Frest%2Fv3%2Fstatus%2F0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf',
'sinclair:ad_postroll': 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&iu=/4756/OTT_Gateway/TC&vpos=postroll&url=http%3A%2F%2Fstirr-mrss-adapter.sinclairstoryline.com%2Fapi%2Frest%2Fv3%2Fstatus%2F0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf&description_url=http%3A%2F%2Fstirr-mrss-adapter.sinclairstoryline.com%2Fapi%2Frest%2Fv3%2Fstatus%2F0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf',
'sinclair:attributes': {
'sinclair:ads': {
'sinclair:daiAdParams': {
'description_url': 'https://tennischanneleverywhere.com'
}
}
},
'sinclair:status': {
'sinclair:displayText': '',
'state': '',
'reason': ''
},
'media:title': {
'content': 'Real People'
},
'media:description': {
'content': 'Featuring a school for bagpipers, motorized bar stools, and Disco Sally.'
},
'media:thumbnail': [
{
'width': '1920',
'height': '1080',
'url': 'https://komonews.com/resources/media2/16x9/full/1920/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full16x9_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '1920',
'height': '640',
'url': 'https://komonews.com/resources/media2/3x1/full/1920/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full3x1_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '1440',
'height': '1440',
'url': 'https://komonews.com/resources/media2/1x1/full/1440/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full1x1_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '899',
'height': '500',
'url': 'https://komonews.com/resources/media2/16x9/full/899/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full16x9_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '548',
'height': '308',
'url': 'https://komonews.com/resources/media2/16x9/full/548/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full16x9_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '375',
'height': '563',
'url': 'https://komonews.com/resources/media2/2x3/full/375/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full2x3_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '448',
'height': '252',
'url': 'https://komonews.com/resources/media2/16x9/full/448/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full16x9_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '410',
'height': '615',
'url': 'https://komonews.com/resources/media2/2x3/full/410/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full2x3_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '473',
'height': '267',
'url': 'https://komonews.com/resources/media2/16x9/full/473/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full16x9_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '375',
'height': '211',
'url': 'https://komonews.com/resources/media2/16x9/full/375/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full16x9_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '219',
'height': '123',
'url': 'https://komonews.com/resources/media2/16x9/full/219/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full16x9_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
},
{
'width': '600',
'height': '338',
'url': 'https://komonews.com/resources/media2/16x9/full/600/center/90/015a7576-6fc7-425d-9937-408d11f74b08-full16x9_undefinede31e5e1dde2644f98bafc75e3d583ecarealpeopleseason33vod75dcdbf745aa4e8683a08f48700a367depisode23teaser.jpg?cb=cfcd208495d565ef66e7dff9f98764da'
}
],
'sinclair:logo': {
'width': '119',
'height': '39',
'text': 'On Demand',
'url': 'https://komonews.com/resources/media2/3x1/full/119/center/90/44e3adac-d9ed-4f62-b8e7-3bc5d09d94cc-small3x1_STIRR_LOGO_0220_STIRRCity_1920x1080_EPG.png?cb=eccbc87e4b5ce2fe28308fd9f2a7baf3'
},
'medium': 'video',
'sinclair:ident': '0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf',
'expression': 'nonstop',
'type': 'application/x-mpegURL',
'url': 'https://dai.google.com/linear/hls/event/4aD5IJf0QgKUJwPbq2fngg/master.m3u8',
'duration': '0',
'sinclair:isLive': 'false',
'sinclair:isLiveProgram': 'false',
'sinclair:url': 'dai://4aD5IJf0QgKUJwPbq2fngg'
}
},
'id': '0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf',
'link': 'https://ott-gateway-stirr.sinclairstoryline.com/api/rest/v3/status/0cf15df7-1dbc-4dac-bc8d-867e8ab3d3cf',
'description': 'Watch the latest breaking news and weather from the National region. Powered by WJLA',
'title': 'STIRR | National'
},
'version': '2'}
}
"""