Net::UPnP(3pm)
β¨ Net::UPnP β¨
okay bestie, welcome to Net::UPnP β the Perl extension for UPnP π (that's User Contributed Perl Documentation, for the record, and yeah we're in the 3pm manual section π)
πΈ SYNOPSIS πΈ
here's the whole vibe, verbatim, no edits, copy it exactly:
use Net::UPnP::ControlPoint;
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;
}
$condir_service = $dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1');
unless (defined(condir_service)) {
next;
}
%action_in_arg = (
'ObjectID' => 0,
'BrowseFlag' => 'BrowseDirectChildren',
'Filter' => '*',
'StartingIndex' => 0,
'RequestedCount' => 0,
'SortCriteria' => '',
);
$action_res = $condir_service->postcontrol('Browse', \%action_in_arg);
unless ($action_res->getstatuscode() == 200) {
next;
}
$actrion_out_arg = $action_res->getargumentlist();
unless ($actrion_out_arg->{'Result'}) {
next;
}
$result = $actrion_out_arg->{'Result'};
while ($result =~ m/<dc:title>(.*?)<\/dc:title>/sgi) {
print "\t$1\n";
}
$devNum++;
}
like, it's giving full discovery-to-browse pipeline and honestly? iconic π
π¦ DESCRIPTION π¦
so this package hands you a bunch of functions for controlling UPnP devices π
as of right now, it only ships functions for the control point side of things. wanna actually control UPnP devices? go look at Net::UPnP::ControlPoint π
and as a lil sample of what a control point can do, the package also gives you Net::UPnP::AV::MediaServer for wrangling devices like DLNA media servers πΊβ¨. for an example in the wild, check out dms2vodcast.pl, which converts from MPEG2 movies to MPEG4 ones and spits out the RSS file for Vodcasting π¬β‘οΈπ» no cap.
π SEE ALSO π
Net::UPnP::ControlPointNet::UPnP::AV::MediaServer
go read those too, bestie, they're the main characters of this whole saga π«Ά
π 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 the BSD License π β slay, permissive licensing is so real
and that's the whole page, bestie!! π this was perl v5.36.0, dated 2022-12-06 β tysm for reading, mwah, go browse some ContentDirectory like the queen you are ππ β¨
π¦ 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