Bug 134028 - "Download Media" of podcast does not seem to apply proxy settings.
Summary: "Download Media" of podcast does not seem to apply proxy settings.
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Podcast (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-13 20:58 UTC by rumagent
Modified: 2006-11-02 01:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rumagent 2006-09-13 20:58:07 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Gentoo Packages
Compiler:          GCC 4.1.1 
OS:                Linux

I sit behind a firewall and must use a proxy. When I try to download ("Download Media" ) a podcast nothing happens (basically times out). If I try to stream/play the sane podcast it works without problems. My guess is that the proxy settings are not being applied. I compiled amarok with debug and got the following when attempting to download a podcast:

amarok: BEGIN: void PodcastEpisode::downloadMedia()
amarok:   [void PodcastEpisode::downloadMedia()] thread: None
amarok:   [KDE::ProgressBar::ProgressBar(QWidget*, QLabel*)]
amarok:   connecting 2progress( const QObject*, int ) LOOKATME
amarok: END__: void PodcastEpisode::downloadMedia() - Took 0.0029s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0012s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.0014s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00023s
amarok: END__: virtual bool ScanController::doJob() - Took 0.0003s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 4.7e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.0014s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.002s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.0021s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00026s
amarok: END__: virtual bool ScanController::doJob() - Took 0.00033s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 4.9e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.0014s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0019s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.002s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00034s
amarok: END__: virtual bool ScanController::doJob() - Took 0.00056s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 5e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.0021s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0019s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.002s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00033s
amarok: END__: virtual bool ScanController::doJob() - Took 0.00056s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 4.7e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.002s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0013s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.0014s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00026s
amarok: END__: virtual bool ScanController::doJob() - Took 0.00033s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 5.1e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.0016s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0013s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.0014s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.0003s
amarok: END__: virtual bool ScanController::doJob() - Took 0.00038s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 5.9e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.017s
amarok: Unable to retrieve podcast media. KIO Error: 3
amarok: [virtual KDE::ProgressBar::~ProgressBar()]
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0012s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.0014s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00026s
amarok: END__: virtual bool ScanController::doJob() - Took 0.00033s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 5.1e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.0017s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0012s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.0013s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00025s
amarok: END__: virtual bool ScanController::doJob() - Took 0.00032s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 4.8e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.0015s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0019s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.002s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00033s
amarok: END__: virtual bool ScanController::doJob() - Took 0.00056s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 4.8e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.002s
amarok: BEGIN: ScanController::ScanController(CollectionDB*, bool, const QStringList&)
amarok: BEGIN: void ScanController::initIncremental()
amarok: END__: void ScanController::initIncremental() - Took 0.0019s
amarok: END__: ScanController::ScanController(CollectionDB*, bool, const QStringList&) - Took 0.0021s
amarok: BEGIN: virtual void ThreadWeaver::Thread::run()
amarok: BEGIN: virtual bool ScanController::doJob()
amarok: BEGIN: SqliteConnection::SqliteConnection(const SqliteConfig*)
amarok: END__: SqliteConnection::SqliteConnection(const SqliteConfig*) - Took 0.00037s
amarok: END__: virtual bool ScanController::doJob() - Took 0.0006s
amarok:   [CollectionDB] JobFinishedEvent from Incremental ScanController received.
amarok:   [ThreadWeaver] Job completed: CollectionScanner. Jobs pending: 0
amarok: BEGIN: virtual ScanController::~ScanController()
amarok: END__: virtual ScanController::~ScanController() - Took 5e-05s
amarok: END__: virtual void ThreadWeaver::Thread::run() - Took 0.0021s
amarok: [ThreadWeaver] Threads in pool: 2



Hope someone can help. Please feel free to contact me if there is any information lacking.

/Rune
Comment 1 rumagent 2006-09-16 21:45:37 UTC
It is amarok 1.4.3 by the way
Comment 2 Alexandre Oliveira 2006-09-16 21:49:43 UTC
That's right, it'll ignore proxies.
Comment 3 brad 2006-11-01 22:03:42 UTC
This bug seems to still exists in version 1.4.4. This is similar to bug:131137.   PodcastFetcher is using qhttp which doesn't seem to have a proxy option built in. It looks like ktrm.cpp uses KProtocolManager::reparseConfiguration() to pick out the proxies from kcontrol, but you probably want to use KIO to pull down the podcasts. 

Comment 4 Alexandre Oliveira 2006-11-01 22:16:08 UTC
We used KIO, it was changed to qhttp for some reason I can't remember. I gotta check the logs.
Comment 5 Alexandre Oliveira 2006-11-02 01:50:53 UTC
SVN commit 601084 by aoliveira:

When downloading podcasts, proxy settings would be ignored.
BUG: 134028


 M  +18 -4     playlistbrowseritem.cpp  


--- trunk/extragear/multimedia/amarok/src/playlistbrowseritem.cpp #601083:601084
@@ -2331,13 +2331,21 @@
 
 PodcastFetcher::PodcastFetcher( QString url, const KURL &directory, int size ):
         m_url( QUrl( url )),
-        m_http( new QHttp( m_url.host() ) ),
         m_directory ( directory ),
         m_error( 0 ),
         m_size( size )
 {
 
     m_redirected = false;
+
+    QString proxy = Amarok::proxyForUrl( m_url );
+    if ( proxy.isNull() )
+        m_http = new QHttp( m_url.host() );
+    else {
+        QUrl proxyUrl( proxy );
+        m_http = new QHttp( proxyUrl.host(), proxyUrl.port() );
+    }
+
     connect( (m_http), SIGNAL( responseHeaderReceived ( const QHttpResponseHeader & ) ), this,
                       SLOT( slotResponseReceived( const QHttpResponseHeader & ) ) );
     connect( (m_http), SIGNAL( done( bool ) ), this, SLOT( slotDone( bool ) ) );
@@ -2379,8 +2387,14 @@
         }
         m_file.setName( file.filePath() );
     }
-    m_http->get( m_url.encodedPathAndQuery(), (&m_file) );
-   // debug() << m_http->currentId() << " get( http://"<< m_url.host() << m_url.encodedPathAndQuery() << " )" << endl;
+
+    // Qhttp::get() "conviniently" "corrects" the path in a way that wouldn't let it work
+    // work with proxies. So let's create the request manually.
+    QHttpRequestHeader request( "GET", m_url );
+    request.setValue( "Host", m_url.host() + ":" + m_url.port() );
+    request.setValue( "Connection", "Keep-Alive" );
+    m_http->request( request, 0, (&m_file) );
+
     if( m_http->error() )
         debug() <<  m_http->errorString() << endl;
 }
@@ -2408,7 +2422,7 @@
 
 void PodcastFetcher::slotResponseReceived( const QHttpResponseHeader & resp )
 {
-//        debug() << m_http->currentId() << " RESPONCE, statuscode = " << resp.statusCode() << endl;
+//    debug() << m_http->currentId() << " RESPONCE, statuscode = " << resp.statusCode() << endl;
     if( resp.statusCode() == 302 || resp.statusCode() == 301 )
     {
         if (resp.hasKey( "location" ) )