[TOPBLOCKER] 7digital previews do not play in the scope

Bug #1381930 reported by Brendan Donegan
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qtbase-opensource-src (Ubuntu)
Invalid
Undecided
Unassigned
qtubuntu-media (Ubuntu)
Fix Released
Critical
Jim Hodapp
qtubuntu-media (Ubuntu RTM)
Fix Released
Critical
Jim Hodapp
unity-scope-mediascanner (Ubuntu)
Invalid
Critical
Unassigned
unity-scopes-api (Ubuntu)
Fix Released
High
Paweł Stołowski
unity-scopes-api (Ubuntu RTM)
Fix Released
Critical
Unassigned
unity8 (Ubuntu)
Invalid
Critical
Michał Sawicz
unity8 (Ubuntu RTM)
Invalid
Critical
Unassigned

Bug Description

Steps to reproduce:

1. Navigate to the music scope
2. In the section 'New albums from 7digital' click on any album
3. Press the play button on one of the track previews

Expected result:

The preview plays

Actual result:

No preview plays

ProblemType: Bug
DistroRelease: Ubuntu RTM 14.09
Package: unity-scope-mediascanner2 0.2+14.10.20141009-0ubuntu1
Uname: Linux 3.4.67 armv7l
ApportVersion: 2.14.7-0ubuntu5
Architecture: armhf
Date: Thu Oct 16 08:11:12 2014
InstallationDate: Installed on 2014-10-16 (0 days ago)
InstallationMedia: Ubuntu Utopic Unicorn (development branch) - armhf (20141016-010328)
SourcePackage: unity-scope-mediascanner
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :
tags: added: rtm14
Changed in unity-scope-mediascanner (Ubuntu):
importance: Undecided → Critical
status: New → Confirmed
Olli Ries (ories)
tags: added: touch-2014-10-23
Changed in ubuntu-rest-scopes:
importance: Undecided → Critical
Revision history for this message
James Henstridge (jamesh) wrote :

Adding a bug task for ubuntu-rest-scopes, since that is where the 7digital results come from (the Music page on the dash is just aggregating them).

Using scopes-client, the data for the audio tracks in the previews looks like e.g:

  {
    "length":209,
    "source":"http://previews.7digital.com/clip/39903197?oauth_nonce=96292359&oauth_timestamp=1413518820&oauth_consumer_key=7d7e9ja2evm7&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_signature=L0xPZSEB2DnM%2BJxrCZMFiv2gPms%3D",
    "title":"01. County Line",
  }

It looks like 7digital performs some user agent sniffing for these URLs, since requests for this URL with wget result in a 403 forbidden error, but successfully send the MP3 data if I use a blank or nonsense user agent. Presumably the in-dash playback is being blocked in a similar fashion.

So to sum up, the questions are:

 1. what UA does the dash send when it tries to play audio in previews?
 2. If that UA is generic and shared by apps on other platforms, we should probably change it.
 3. If that UA is unique to Ubuntu, then 7digital is explicitly blocking us and someone needs to get in contact with them to sort it out.

Changed in ubuntu-rest-scopes:
assignee: nobody → Facundo Batista (facundo)
Changed in unity-scope-mediascanner (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Facundo Batista (facundo) wrote :

The URL is coming from the server is ok, like the one pointing James above, or this example:

  http://previews.7digital.com/clip/40202347?oauth_nonce=05780389&oauth_timestamp=1413816139&country=US&oauth_consumer_key=7d7e9ja2evm7&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_signature=FVgXk5tzbSyyB6/g/78GO8REavA%3D

The problem is that at some point it's get mangled. See what unity8 logs in the device (unity8-dash.log):

  Setting media to: QUrl( "http://previews.7digital.com/clip/40202347?oauth_nonce=05780389&oauth_timestamp=1413816139&country=US&oauth_consumer_key=7d7e9ja2evm7&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&oauth_signature=FVgXk5tzbSyyB6/g/78GO8REavA=" )

(pay extra attention to the last character in the URL)

Changing the project to unity8 as for Saviq recomendation in IRC.

affects: ubuntu-rest-scopes → unity8
Michał Sawicz (saviq)
affects: unity8 → unity8 (Ubuntu)
Changed in unity8 (Ubuntu):
assignee: Facundo Batista (facundo) → nobody
Revision history for this message
Michał Sawicz (saviq) wrote :

I looked at it before (I even think there was a bug already...), it seems to be QUrl that unescapes things in the params.

kevin gunn (kgunn72)
tags: added: touch-2014-10-30
removed: touch-2014-10-23
kevin gunn (kgunn72)
Changed in unity8 (Ubuntu RTM):
importance: Undecided → Critical
Revision history for this message
Lorn Potter (lorn-potter) wrote :

After initial testing, it looks like something like this needs to get used:
    url.setPath(path,QUrl::DecodedMode);

As the default mode, QUrl::TolerantMode as well as QUrl::StrictMode result in the '%3D' getting mangled.

Revision history for this message
kevin gunn (kgunn72) wrote :

seems it's gonna take a little digging.
pushing out target date
assign to saviq so it's not lost

Changed in unity8 (Ubuntu RTM):
assignee: nobody → Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
assignee: nobody → Michał Sawicz (saviq)
tags: added: touch-2014-11-13
removed: touch-2014-10-30
Olli Ries (ories)
summary: - 7digital previews do not play in the scope
+ [TOPBLOCKER] 7digital previews do not play in the scope
Revision history for this message
Lorn Potter (lorn-potter) wrote :

I found this which might be the problem:

QUrl AalMediaPlayerControl::unescape(const QMediaContent &media) const
{
    if (media.isNull())
        return QUrl();

    return QUrl::fromPercentEncoding(media.canonicalUrl().toString().toUtf8());
}

I tested this with a small commandline thing, and fromPercentEncoding() can mangle that url
:
QString str = "http://previews.7digital.com/clip/40202347?oauth_signature=FVgXk5tzbSyyB6/g/78GO8REavA%3D";
 qDebug() << QUrl::fromPercentEncoding(str.toUtf8());

output: "http://previews.7digital.com/clip/40202347?oauth_signature=FVgXk5tzbSyyB6/g/78GO8REavA="

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu RTM):
status: New → Incomplete
Changed in unity8 (Ubuntu):
status: New → Incomplete
Revision history for this message
Michał Sawicz (saviq) wrote :

This above is in qtubuntu-media, we need to look through why it's using that code and whether we can improve this!

Changed in qtbase-opensource-src (Ubuntu):
status: New → Incomplete
Changed in qtubuntu-media (Ubuntu):
assignee: nobody → Jim Hodapp (jhodapp)
Jim Hodapp (jhodapp)
Changed in qtubuntu-media (Ubuntu):
status: New → Confirmed
Michał Sawicz (saviq)
Changed in unity8 (Ubuntu RTM):
status: Incomplete → Invalid
Changed in unity8 (Ubuntu):
status: Incomplete → Invalid
Changed in unity8 (Ubuntu RTM):
assignee: Michał Sawicz (saviq) → nobody
Revision history for this message
Jim Hodapp (jhodapp) wrote :

With the linked branch for qtubuntu-media, I can see that it's passing through an unmodified URI to playbin. However, when it tries to play the 7digital stream, I'm seeing a not authorized HTTP return code from souphttpsrc. How exactly does a user get authenticated to be able to play a 7digital stream?

Changed in qtubuntu-media (Ubuntu):
status: Confirmed → Fix Committed
Changed in qtubuntu-media (Ubuntu RTM):
status: New → Fix Committed
assignee: nobody → Jim Hodapp (jhodapp)
Revision history for this message
Michał Sawicz (saviq) wrote :
Changed in qtbase-opensource-src (Ubuntu):
status: Incomplete → Invalid
Changed in qtubuntu-media (Ubuntu):
status: Fix Committed → In Progress
Changed in qtubuntu-media (Ubuntu RTM):
status: Fix Committed → In Progress
Michał Sawicz (saviq)
Changed in unity-scopes-api (Ubuntu):
status: New → In Progress
assignee: nobody → Pawel Stolowski (stolowski)
Revision history for this message
Olli Ries (ories) wrote :

set active tasks to critical to express that it's a [TOPBLOCKER]

Changed in qtubuntu-media (Ubuntu):
importance: Undecided → Critical
Changed in qtubuntu-media (Ubuntu RTM):
importance: Undecided → Critical
Changed in unity-scopes-api (Ubuntu):
importance: Undecided → Critical
Changed in unity-scopes-api (Ubuntu RTM):
importance: Undecided → Critical
Revision history for this message
Paweł Stołowski (stolowski) wrote :

The fixes for this bug are currently pending QA sign off.

Jim Hodapp (jhodapp)
Changed in qtubuntu-media (Ubuntu):
status: In Progress → Fix Committed
Changed in qtubuntu-media (Ubuntu RTM):
status: In Progress → Fix Committed
Changed in unity-scopes-api (Ubuntu):
status: In Progress → Fix Committed
Changed in unity-scopes-api (Ubuntu RTM):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtubuntu-media - 0.7.1+15.04.20141107-0ubuntu1

---------------
qtubuntu-media (0.7.1+15.04.20141107-0ubuntu1) vivid; urgency=low

  [ Jim Hodapp ]
  * Fix URI encoding issue related to playing remote URIs like from
    7digital (LP: #1381930)

  [ Ubuntu daily release ]
  * New rebuild forced
 -- Ubuntu daily release <email address hidden> Fri, 07 Nov 2014 03:23:56 +0000

Changed in qtubuntu-media (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtubuntu-media - 0.7.1+15.04.20141107~rtm-0ubuntu1

---------------
qtubuntu-media (0.7.1+15.04.20141107~rtm-0ubuntu1) 14.09; urgency=low

  [ Jim Hodapp ]
  * Fix URI encoding issue related to playing remote URIs like from
    7digital (LP: #1381930)

  [ Ubuntu daily release ]
  * New rebuild forced

qtubuntu-media (0.7.1+15.04.20141105.2-0ubuntu1) vivid; urgency=low

  [ thomas-voss ]
  * Get rid of custom ref-counting and reuse pre-created object. (LP:
    #1387959)
 -- Ubuntu daily release <email address hidden> Fri, 07 Nov 2014 03:17:43 +0000

Changed in qtubuntu-media (Ubuntu RTM):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-scopes-api - 0.6.7+15.04.20141107.1~rtm-0ubuntu1

---------------
unity-scopes-api (0.6.7+15.04.20141107.1~rtm-0ubuntu1) 14.09; urgency=low

  [ Pawel Stolowski ]
  * Fix parameter order for the smart scopes preview request. (LP:
    #1381930)
 -- Ubuntu daily release <email address hidden> Fri, 07 Nov 2014 20:23:45 +0000

Changed in unity-scopes-api (Ubuntu RTM):
status: Fix Committed → Fix Released
Revision history for this message
Olli Ries (ories) wrote :

marking the remaining Ubuntu task as high to get off rtm list

Changed in unity-scopes-api (Ubuntu):
importance: Critical → High
Changed in unity-scopes-api (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.