Net::U...tainer(3pm)
okay bestie, sit down, hydrate, because we're reading a manpage together π
This is Net::U...tainer(3pm) β yeah, that's the whole name, truncated and mysterious and honestly kinda iconic β living in User Contributed Perl Documentation. Its real, full government name is Net::UPnP::AV::Container, and it's a Perl extension for UPnP. She's a container. She contains things. Slay.
β¨ NAME β¨
Net::UPnP::AV::Container β Perl extension for UPnP.
that's it. that's the whole name section. short, sweet, main character energy π
π SYNOPSIS π
okay so this is the whole vibe, copy it exactly, no notes:
use Net::UPnP::ControlPoint;
use Net::UPnP::AV::MediaServer;
my $obj = Net::UPnP::ControlPoint->new();
@dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3);
$devNum= 0;
foreach $dev (@dev_list) {
$device_type = $dev->getdevicetype();
if ($device_type ne 'urn:schemas-upnp-org:device:MediaServer:1') {
next;
}
print "[$devNum] : " . $dev->getfriendlyname() . "\n";
unless ($dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1')) {
next;
}
$mediaServer = Net::UPnP::AV::MediaServer->new();
$mediaServer->setdevice($dev);
@content_list = $mediaServer->getcontentlist(ObjectID => 0);
foreach $content (@content_list) {
print_content($mediaServer, $content, 1);
}
$devNum++;
}
sub print_content {
my ($mediaServer, $content, $indent) = @_;
my $id = $content->getid();
my $title = $content->gettitle();
for ($n=0; $n<$indent; $n++) {
print "\t";
}
print "$id = $title";
if ($content->isitem()) {
print " (" . $content->geturl();
if (length($content->getdate())) {
print " - " . $content->getdate();
}
print " - " . $content->getcontenttype() . ")";
}
print "\n";
unless ($content->iscontainer()) {
return;
}
@child_content_list = $mediaServer->getcontentlist(ObjectID => $id );
if (@child_content_list <= 0) {
return;
}
$indent++;
foreach my $child_content (@child_content_list) {
print_content($mediaServer, $child_content, $indent);
}
}
like, look at her go π¦ β searching for devices, checking that $device_type isn't 'urn:schemas-upnp-org:device:MediaServer:1', skipping anyone who doesn't have 'urn:schemas-upnp-org:service:ContentDirectory:1', then walking the content tree recursively with print_content and tabs for indent. a whole little ecosystem. we love to see it.
π DESCRIPTION π
So. The package is an extension for a UPnP/AV media server, and it's a sub class of Net::UPnP::AV::Content. That's the tea, fr fr β it inherits, it extends, it does container things. π«Ά
π METHODS π
every method, in order, nothing skipped, because we are thorough girlies π
iscontainer β Check if the content is a container.
$isContainer = $container->iscontainer();
Check if the content is a container. that's literally the whole job. is it a container? yes or no. vibe check complete π
getid β Get the content ID.
$id = $item->getid();
Get the content ID. you want the ID? here's the ID. β¨
gettitle β Get the content title.
$title = $item->gettitle();
Get the content title. the name. the label. the whole branding moment. π
getdate β Get the content date.
$date = $item->getdate();
Get the content date. when it happened. timestamped. β
π SEE ALSO π
go read these too, bestie, they're the extended universe:
Net::UPnP::AV::ContentNet::UPnP::AV::Item
π AUTHOR π
Satoshi Konno β skonno@cybergarage.org π
CyberGarage β http://www.cybergarage.org
the way that a real human wrote this and we're all just out here using it. iconic. give them their flowers. πΈ
π COPYRIGHT AND LICENSE π
Copyright (C) 2005 by Satoshi Konno
It may be used, redistributed, and/or modified under the terms of BSD License. periodt. use it, share it, remix it, just respect the BSD terms π
and that's the whole page, bestie!! ππ this one came from perl v5.36.0 and is dated 2022-12-06, and yeah β the footer calls her Net::U...tainer(3pm) one last time because the manpage name is long and the terminal is a hater. go forth and recurse through some containers. mwah. π§β¨
π¦ where this page comes from
- debian bookworm: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- debian trixie: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu noble: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu resolute: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu stonking: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms