Net::U...ontent(3pm)
π NAME π
Net::UPnP::AV::Content β bestie, it's a Perl extension for UPnP. That's the whole vibe. π¦
β¨ SYNOPSIS β¨
okay so here's literally how you use it, no cap:
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);
}
}
πΈ DESCRIPTION πΈ
So this package is a extension UPnP/AV media server, and it's also a super class of Net::UPnP::AV::Container and Net::UPnP::AV::Item. It's giving "parent energy" β the main character that the other two inherit from. π
π METHODS π
getid β Get the content ID.
$id = $item->getid();
Gets the content ID. That's it, that's the whole job. π
gettitle β Get the content title.
$title = $item->gettitle();
Gets the content title. Iconic, honestly. β¨
getdate β Get the content date.
$date = $item->getdate();
Gets the content date. Periodt. π¦
π«Ά SEE ALSO π«Ά
Net::UPnP::AV::ItemNet::UPnP::AV::Container
β AUTHOR β
Satoshi Konno <skonno@cybergarage.org>
CyberGarage <http://www.cybergarage.org>
π COPYRIGHT AND LICENSE π
Copyright (C) 2005 by Satoshi Konno
It may be used, redistributed, and/or modified under the terms of BSD License.
fr fr, that's the license, don't be weird about it π
okay bestie that's a wrap β this page came to you from the <strong>User Contributed Perl Documentation</strong>, perl v5.36.0, dated 2022-12-06. slay, go build something cute with it ππ
π¦ 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