Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(at': 0.04; 'subject:IDLE': 0.04; 'subject:Python': 0.06; 'linux,': 0.07; 'plenty': 0.07; 'utf-8': 0.07; 'bishop': 0.09; 'editor.': 0.09; 'fashion.': 0.09; 'subject: [': 0.09; 'cc:addr:python-list': 0.11; 'stored': 0.12; '<>.': 0.14; 'windows': 0.15; 'attempted': 0.16; 'grep': 0.16; 'idea:': 0.16; 'perl.': 0.16; 'segment': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'wed,': 0.18; 'solution.': 0.20; 'written': 0.21; 'aug': 0.22; 'pages,': 0.22; 'cc:addr:python.org': 0.22; 'logical': 0.24; 'own.': 0.24; 'fine': 0.24; 'initial': 0.24; "haven't": 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'daniel': 0.26; 'downloaded': 0.26; 'header :In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'xml': 0.29; 'message-id:@mail.gmail.com': 0.30; 'program,': 0.31; 'code': 0.31; '(on': 0.31; 'own,': 0.31; 'subject:what': 0.31; 'anyone': 0.31; 'file': 0.32; 'text': 0.33; 'worked': 0.33; 'addresses': 0.33; 'plain': 0.33; 'sense': 0.34; 'subject:the': 0.34; 'could': 0.34; 'subject:with': 0.35; 'skip:s 30': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'adjust': 0.36; 'url:org': 0.36; 'list': 0.37; 'improving': 0.38; 'mine': 0.38; 'list,': 0.38; 'eventually': 0.60; 'manually': 0.60; 'radio': 0.60; 'august': 0.61; 'john': 0.61; 'from:charset:utf-8': 0.61; 'first': 0.61; 'here:': 0.62; 'show': 0.63; 'more': 0.64; 'different': 0.65; 'programme': 0.65; 'skip:\xe2 10': 0.65; 'sample': 0.67; 'containing': 0.69; '8bit%:43': 0.74; 'drive.': 0.84; 'it\xe2\x80\x99s': 0.84; 'subject:BBC': 0.84; 'visit,': 0.84; 'thing,': 0.91; 'hands': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=yNIf2AyZQf/ndjfCPL7Pm0g1ISdLsy4sgo6ALnJLspE=; b=bZwhVE7W1uOAl/86siOtBYmmWY5d/VVf9xfD8JAHtrC+OKJgI9oeaI+qjD0YcVp9O7 ppJqsqOVigf/yvI07V2ETdhyp0xUezPxAlgDW8gzrQIkkOnaqSoiq4lkKdwmAQFKRc8E iqLDzpipXR99CXj2dOUmPx2CAso89OYjZwiysfCfpJxZXJmyLLC1g4PB5s/oKAzIMpdO yYPHiMzYOC96WxwpBl1LMEaFKfdiIsPps4XWViTJKoF3fSWsDoiGzpJH7dGbqY7qRRcS /6tKCWzGu0a7sZ8vDcvR1hZ1ShOTL6wAZQsFQ+Cs8bmXzQwF45d2tQtWbhRTaAbqyKaV xvMw== MIME-Version: 1.0 X-Received: by 10.43.75.7 with SMTP id yy7mr13828446icb.15.1409127127342; Wed, 27 Aug 2014 01:12:07 -0700 (PDT) In-Reply-To: References: <4eec9365-4103-4474-a47f-ea665b265b1e@googlegroups.com> <9f7fceb8-cb57-4525-a9a4-e9bc83c05ed2@googlegroups.com> <53fd2083$0$30001$c3e8da3$5496439d@news.astraweb.com> <5f5e1c19-a731-4de1-aa09-fc773605546a@googlegroups.com> Date: Wed, 27 Aug 2014 10:12:07 +0200 Subject: Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] From: =?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= To: Twirlip2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409127129 news.xs4all.nl 2897 [2001:888:2000:d::a6]:59797 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77118 On Wed, Aug 27, 2014 at 2:58 AM, Twirlip2 wrote: > It just pulls a lot of HTML and XML from the website, and extracts the > addresses of various other pages, and eventually *.WMA streams, and > hands the stream URLs over to XMPlay . > > It 'knows' what pages to visit, because I have manually built up a plain > text file containing a list of (at the moment) 274 BBC radio programmes, > represented by 579 different mnemonic key strings - of which the user > only needs to type in a sufficiently long initial segment to disambiguate= . > > Anyone else could use the same list, or build up their own, or use mine a= s > a basis for their own. (I just maintain it using a text editor. I haven'= t > [yet] attempted to do any database programming.) > > I have plenty of ideas for improving the program, but first I have to > re-organise the present spaghetti code in a more logical fashion. I have a better idea: use an existing solution. get_iplayer, to be precise= . See here: http://www.infradead.org/get_iplayer/html/get_iplayer.html It=E2=80=99s written in Perl. They claim to have a Windows installer. I h= ave not tested the Windows thing, but it worked fine when I set it up on Linux, and managed to download a radio programme on August 12th. Sample usage (on Linux, you might need to adjust for no grep) $ get_iplayer --type=3Dradio --refresh | grep 'Chris Evans' 12876: The Chris Evans Breakfast Show - Borrowing Boyfriends, BBC Radio 2, Discussion & Talk Shows,Entertainment,Music,Radio 12877: The Chris Evans Breakfast Show - 21/08/2014, BBC Radio 2, Discussion & Talk Shows,Entertainment,Music,Radio 12878: The Chris Evans Breakfast Show - Peter Capaldi, Daniel Radcliffe, Jon Hamm and Ruby Turner, BBC Radio 2, Discussion & Talk Shows,Entertainment,Music,Radio 12879: The Chris Evans Breakfast Show - John Bishop sits in, BBC Radio 2, Discussion & Talk Shows,Entertainment,Music,Radio 12880: The Chris Evans Breakfast Show - Babooshka!, BBC Radio 2, Discussion & Talk Shows,Entertainment,Music,Radio $ get_iplayer --type=3Dradio 12878 --get And kaboom, #12878, "Peter Capaldi, Daniel Radcliffe, Jon Hamm and Ruby Turner", is downloaded and stored on your hard drive. --=20 Chris =E2=80=9CKwpolska=E2=80=9D Warrick PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense