2
2
* @file ns_media.c Yahoo media namespace support
4
* Copyright (C) 2007-2009 Lars Lindner <lars.lindner@gmail.com>
4
* Copyright (C) 2007-2010 Lars Lindner <lars.lindner@gmail.com>
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
60
60
if (!xmlStrcmp(cur->name, BAD_CAST"content")) {
61
61
tmp = xml_get_attribute (cur, "url");
63
/* the following code is duplicated from rss_item.c! */
63
/* the following code is duplicated from rss_item.c! */
64
const gchar *feedURL = subscription_get_homepage (ctxt->subscription);
64
66
gchar *type = xml_get_attribute (cur, "type");
65
67
gchar *lengthStr = xml_get_attribute (cur, "length");
66
68
gchar *medium = xml_get_attribute (cur, "medium");
69
71
length = atol (lengthStr);
71
if ((strstr (tmp, "://") == NULL) &&
72
(ctxt->feed->htmlUrl != NULL) &&
73
(ctxt->feed->htmlUrl[0] != '|') &&
74
(strstr (ctxt->feed->htmlUrl, "://") != NULL)) {
73
if ((strstr (tmp, "://") == NULL) && feedURL && (feedURL[0] != '|') &&
74
(strstr (feedURL, "://") != NULL)) {
75
75
/* add base URL if necessary and possible */
76
tmp2 = g_strdup_printf ("%s/%s", ctxt->feed->htmlUrl, tmp);
76
tmp2 = g_strdup_printf ("%s/%s", feedURL, tmp);