File: reference-entry-enclosures.rst

package info (click to toggle)
feedparser 6.0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,540 kB
  • sloc: xml: 11,459; python: 4,575; makefile: 7
file content (47 lines) | stat: -rw-r--r-- 1,380 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.. _reference.entry.enclosures:

:py:attr:`entries[i].enclosures`
================================

A list of links to external files associated with this entry.

Some aggregators automatically download enclosures (although this technique has
`known problems <http://gonze.com/weblog/story/5-17-4>`_).  Some aggregators
render each enclosure as a link.  Most aggregators ignore them.

The :abbr:`RSS (Rich Site Summary)` specification states that there can be at
most one enclosure per item.  However, because some feeds break this rule,
:program:`Universal Feed Parser` captures all of them and makes them available
as a list.

.. rubric:: Comes from

- /atom10:feed/atom10:entry/atom10:link[@rel="enclosure"]
- /rss/channel/item/enclosure


.. _reference.entry.enclosures.href:

:py:attr:`entries[i].enclosures[j].href`
----------------------------------------

The :abbr:`URL (Uniform Resource Locator)` of the linked file.

If this is a relative :abbr:`URI (Uniform Resource Identifier)`, it is
:ref:`resolved according to a set of rules <advanced.base>`.


.. _reference.entry.enclosures.length:

:py:attr:`entries[i].enclosures[j].length`
------------------------------------------

The length of the linked file.


.. _reference.entry.enclosures.type:

:py:attr:`entries[i].enclosures[j].type`
----------------------------------------

The content type of the linked file.