Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kévin Darcel committed Sep 7, 2017
2 parents 088d769 + 5273218 commit 4f5fd77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleIdentifier</key>
<string>com.plexapp.plugins.mytf1</string>
<key>CFBundleVersion</key>
<string>1.2.0</string>
<string>1.2.1</string>
<key>PlexFrameworkVersion</key>
<string>2</string>
<key>PlexClientPlatforms</key>
Expand Down
13 changes: 7 additions & 6 deletions Contents/Services/URL/TF1/ServiceCode.pys
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ def MetadataObjectForURL(url):

html = HTML.ElementFromString(get_page(url))

container = html.xpath('//div[contains(@id, "contentPlayer")]/div/div/div/div[contains(@class, "container")]')[0]
section = html.xpath('//section[contains(@id, "content_video")]')[0]
player = section.xpath('//div[contains(@id, "player_video")]/div[contains(@id, "contentPlayer")]/div/div/div[contains(@class, "container")]')[0]

title = container.xpath('./div[contains(@class, "content")]/h1[contains(@class, "title")]/text()')[0]
summary = container.xpath('./div[contains(@class, "content")]/div[contains(@class, "description")]/p/text()')[0]
thumb = 'http:' + container.xpath('./div[contains(@class, "iframe")]/meta[contains(@itemprop, "thumbnailUrl")]/@content')[0]
title = section.xpath('./div[contains(@class, "description_container")]/article/span[contains(@class, "title")]/text()')[0]
summary = section.xpath('./div[contains(@class, "description_container")]/article/div[contains(@class, "description")]/p/text()')[0]
thumb = 'http:' + player.xpath('./div[contains(@class, "iframe")]/meta[contains(@itemprop, "thumbnailUrl")]/@content')[0]
try:
duration = int(container.xpath('./div[contains(@class, "iframe")]/meta[contains(@itemprop, "duration")]/@content')[0]) * 1000
duration = int(player.xpath('./div[contains(@class, "iframe")]/meta[contains(@itemprop, "duration")]/@content')[0]) * 1000
except:
duration = None
try:
oaa = Datetime.ParseDate(container.xpath('./div[contains(@class, "iframe")]/meta[contains(@itemprop, "uploadDate")]/@content')[0])
oaa = Datetime.ParseDate(player.xpath('./div[contains(@class, "iframe")]/meta[contains(@itemprop, "uploadDate")]/@content')[0])
except:
oaa = None

Expand Down

0 comments on commit 4f5fd77

Please sign in to comment.